本文整理匯總了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;
}