當前位置: 首頁>>代碼示例>>Java>>正文


Java Activity.getLayoutInflater方法代碼示例

本文整理匯總了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();
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:9,代碼來源:MediaAudioFilesListAdapter.java

示例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);
}
 
開發者ID:RajneeshSingh007,項目名稱:MusicX-music-player,代碼行數:16,代碼來源:ATE.java

示例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();
}
 
開發者ID:htqqdd,項目名稱:music_player,代碼行數:31,代碼來源:menu_util.java

示例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();
}
 
開發者ID:barisatalay,項目名稱:thermalprinterhelper,代碼行數:14,代碼來源:BluetoothDeviceAdapter.java

示例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();
    }
 
開發者ID:xhd-Git,項目名稱:3DPrint-Controller,代碼行數:32,代碼來源:SharePopupWindow.java

示例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());
}
 
開發者ID:dmllr,項目名稱:IdealMedia,代碼行數:13,代碼來源:ArtistsAdapter.java

示例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();
}
 
開發者ID:InflationX,項目名稱:ViewPump,代碼行數:13,代碼來源:ViewPumpContextWrapper.java

示例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();
}
 
開發者ID:Dnet3,項目名稱:CustomAndroidOneSheeld,代碼行數:9,代碼來源:MusicPlayListAdapter.java

示例9: BaseAdapter

import android.app.Activity; //導入方法依賴的package包/類
public BaseAdapter(Activity context) {
	this.context = context;

	inflater = context.getLayoutInflater();
	resources = context.getResources();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:BaseAdapter.java

示例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));
}
 
開發者ID:kflauri2312lffds,項目名稱:Android_watch_magpie,代碼行數:7,代碼來源:CustomToast.java

示例11: ShoppingCartOverviewAdapter

import android.app.Activity; //導入方法依賴的package包/類
public ShoppingCartOverviewAdapter(Activity activity) {
  this.activity = activity;
  this.layoutInflater = activity.getLayoutInflater();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:ShoppingCartOverviewAdapter.java

示例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;
}
 
開發者ID:Twelvelines,項目名稱:AndroidMuseumBleManager,代碼行數:6,代碼來源:LeDeviceListAdapter.java

示例13: Delegate

import android.app.Activity; //導入方法依賴的package包/類
public Delegate(Activity activity) {
    inflater = activity.getLayoutInflater();
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:4,代碼來源:UpdateableAppsHeader.java

示例14: BaseAdapter

import android.app.Activity; //導入方法依賴的package包/類
public BaseAdapter(Activity activity) {
    this.activity = activity;
    this.list = new ArrayList<>();
    this.inflater = activity.getLayoutInflater();
}
 
開發者ID:hoanganhtuan95ptit,項目名稱:GifEmoji,代碼行數:6,代碼來源:BaseAdapter.java

示例15: InChannelMessageListAdapter

import android.app.Activity; //導入方法依賴的package包/類
public InChannelMessageListAdapter(Activity activity, ArrayList<Message> list) {
    mInflater = activity.getLayoutInflater();
    mMsglist = list;
}
 
開發者ID:AgoraIO,項目名稱:OpenVideoCall-Android,代碼行數:5,代碼來源:InChannelMessageListAdapter.java


注:本文中的android.app.Activity.getLayoutInflater方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。