当前位置: 首页>>代码示例>>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;未经允许,请勿转载。