本文整理汇总了Java中android.app.Activity.getLayoutInflater方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.getLayoutInflater方法的具体用法?Java Activity.getLayoutInflater怎么用?Java Activity.getLayoutInflater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Activity
的用法示例。
在下文中一共展示了Activity.getLayoutInflater方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MediaAudioFilesListAdapter
import android.app.Activity; //导入方法依赖的package包/类
public MediaAudioFilesListAdapter(Activity a, ArrayList<PlaylistItem> items) {
this.activity = (MainActivity) a;
this.items = new CopyOnWriteArrayList<PlaylistItem>();
for (PlaylistItem playlistItem : items) {
this.items.add(playlistItem);
}
inflater = a.getLayoutInflater();
}
示例2: preApply
import android.app.Activity; //导入方法依赖的package包/类
public static void preApply(@NonNull Activity activity, @Nullable String key) {
didPreApply = activity.getClass();
synchronized (IGNORE_TAG) {
if (mPostInflationApply != null) {
mPostInflationApply.clear();
mPostInflationApply = null;
}
}
int activityTheme = activity instanceof ATEActivityThemeCustomizer ?
((ATEActivityThemeCustomizer) activity).getActivityTheme() : Config.activityTheme(activity, key);
if (activityTheme != 0) activity.setTheme(activityTheme);
final LayoutInflater li = activity.getLayoutInflater();
ATEUtil.setInflaterFactory(li, activity);
}
示例3: showMusicInfo
import android.app.Activity; //导入方法依赖的package包/类
public static void showMusicInfo(Activity context,int position){
LayoutInflater inflater = context.getLayoutInflater();
View musicinfo_dialog = inflater.inflate(R.layout.musicinfo_dialog,(ViewGroup) context.findViewById(R.id.musicInfo_dialog));
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("歌曲信息");
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.setView(musicinfo_dialog);
TextView title = (TextView) musicinfo_dialog.findViewById(R.id.dialog_title);
Log.v("title","title"+title);
TextView artist = (TextView) musicinfo_dialog.findViewById(R.id.dialog_artist);
TextView album = (TextView) musicinfo_dialog.findViewById(R.id.dialog_album);
TextView duration = (TextView) musicinfo_dialog.findViewById(R.id.dialog_duration);
TextView playtimes = (TextView) musicinfo_dialog.findViewById(R.id.dialog_playtimes);
TextView path = (TextView) musicinfo_dialog.findViewById(R.id.dialog_path);
title.setText(Data.getTitle(position));
artist.setText(Data.getArtist(position));
album.setText(Data.getAlbum(position));
int totalSecond = Data.getDuration(position)/1000;
int minute = totalSecond/60;
int second = totalSecond - minute*60;
duration.setText(String.valueOf(minute)+"分"+String.valueOf(second)+"秒");
playtimes.setText(String.valueOf(Data.findPlayTimesById(Data.getId(position))));
path.setText(Data.getData(position));
builder.show();
}
示例4: BluetoothDeviceAdapter
import android.app.Activity; //导入方法依赖的package包/类
public BluetoothDeviceAdapter(Activity context, List<BluetoothDevice> list) {
super(context, R.layout.item_bluetoothdevice , list);
this.context = context;
this.allData = new ArrayList<BluetoothDevice>();
this.selectedList = new ArrayList<Integer>();
if(list != null)
allData.addAll(list);
preferences = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
mInflater = context.getLayoutInflater();
refreshDevicAddress();
}
示例5: SharePopupWindow
import android.app.Activity; //导入方法依赖的package包/类
public SharePopupWindow(Activity activity, ShareDataEntity data) {
LayoutInflater inflater = activity.getLayoutInflater();
mContentView = inflater.inflate(R.layout.popup_share, null);
mShareData = data;
mAct = activity;
this.setContentView(mContentView);
this.setWidth(ActionBar.LayoutParams.MATCH_PARENT);
this.setHeight(ActionBar.LayoutParams.WRAP_CONTENT);
this.setFocusable(true);
this.setBackgroundDrawable(new ColorDrawable(Color.argb(127,0,0,0)));
this.setAnimationStyle(R.style.PopupWindowFromBottom);
// LinearLayout wechat = (LinearLayout) mContentView.findViewById(R.id.ll_share_wechat);
// LinearLayout wechatTimeline = (LinearLayout) mContentView.findViewById(R.id.ll_share_wechat_timeline);
// LinearLayout qq = (LinearLayout) mContentView.findViewById(R.id.ll_share_qq);
// LinearLayout qzone = (LinearLayout) mContentView.findViewById(R.id.ll_share_qzone);
// LinearLayout weibo = (LinearLayout) mContentView.findViewById(R.id.ll_share_weibo);
// TextView shareCancel = (TextView) mContentView.findViewById(R.id.tv_share_cancel);
// wechat.setOnClickListener(this);
// wechatTimeline.setOnClickListener(this);
// qq.setOnClickListener(this);
// qzone.setOnClickListener(this);
// weibo.setOnClickListener(this);
// shareCancel.setOnClickListener(this);
layoutParams = mAct.getWindow().getAttributes();
}
示例6: ArtistsAdapter
import android.app.Activity; //导入方法依赖的package包/类
public ArtistsAdapter(Activity activity, ArrayList<Track> data){
this.data = data;
this.activity = activity;
inflater = activity.getLayoutInflater();
listAq = new AQuery(activity);
fadeIn = new AlphaAnimation(0, 1);
fadeIn.setDuration(100);
fadeIn.setInterpolator(new DecelerateInterpolator());
}
示例7: get
import android.app.Activity; //导入方法依赖的package包/类
/**
* Get the ViewPump Activity Fragment Instance to allow callbacks for when views are created.
*
* @param activity The activity the original that the ContextWrapper was attached too.
* @return Interface allowing you to call onActivityViewCreated
*/
static ViewPumpActivityFactory get(@NonNull Activity activity) {
if (!(activity.getLayoutInflater() instanceof ViewPumpLayoutInflater)) {
throw new RuntimeException("This activity does not wrap the Base Context! See ViewPumpContextWrapper.wrap(Context)");
}
return (ViewPumpActivityFactory) activity.getLayoutInflater();
}
示例8: MusicPlayListAdapter
import android.app.Activity; //导入方法依赖的package包/类
public MusicPlayListAdapter(Activity a, ArrayList<PlaylistItem> items) {
this.activity = (MainActivity) a;
this.items = new CopyOnWriteArrayList<PlaylistItem>();
for (PlaylistItem playlistItem : items) {
this.items.add(playlistItem);
}
inflater = a.getLayoutInflater();
}
示例9: BaseAdapter
import android.app.Activity; //导入方法依赖的package包/类
public BaseAdapter(Activity context) {
this.context = context;
inflater = context.getLayoutInflater();
resources = context.getResources();
}
示例10: getView
import android.app.Activity; //导入方法依赖的package包/类
private View getView(Activity activity) {
//Creating the LayoutInflater instance
LayoutInflater li = activity.getLayoutInflater();
//Getting the View object as defined in the customtoast.xml file
return li.inflate(R.layout.toast_confirm, (ViewGroup) activity.findViewById(R.id.toast_confirm));
}
示例11: ShoppingCartOverviewAdapter
import android.app.Activity; //导入方法依赖的package包/类
public ShoppingCartOverviewAdapter(Activity activity) {
this.activity = activity;
this.layoutInflater = activity.getLayoutInflater();
}
示例12: LeDeviceListAdapter
import android.app.Activity; //导入方法依赖的package包/类
public LeDeviceListAdapter(final Activity activity, final EasyObjectCursor<BluetoothLeDevice> cursor) {
super(activity, R.layout.list_item_device, cursor, new String[0], new int[0], 0);
mInflator = activity.getLayoutInflater();
mActivity = activity;
}
示例13: Delegate
import android.app.Activity; //导入方法依赖的package包/类
public Delegate(Activity activity) {
inflater = activity.getLayoutInflater();
}
示例14: BaseAdapter
import android.app.Activity; //导入方法依赖的package包/类
public BaseAdapter(Activity activity) {
this.activity = activity;
this.list = new ArrayList<>();
this.inflater = activity.getLayoutInflater();
}
示例15: InChannelMessageListAdapter
import android.app.Activity; //导入方法依赖的package包/类
public InChannelMessageListAdapter(Activity activity, ArrayList<Message> list) {
mInflater = activity.getLayoutInflater();
mMsglist = list;
}