• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LayoutInflater类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.holoeverywhere.LayoutInflater的典型用法代码示例。如果您正苦于以下问题:Java LayoutInflater类的具体用法?Java LayoutInflater怎么用?Java LayoutInflater使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LayoutInflater类属于org.holoeverywhere包,在下文中一共展示了LayoutInflater类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.tutorial_main);

    View button = rootView.findViewById(R.id.no_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish(true);
        }
    });

    button = rootView.findViewById(R.id.yes_button);
    button.setOnClickListener(beginTutorial);

    return rootView;
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:18,代码来源:TutorialIntroFrag.java


示例2: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.tutorial_snap2);

    View button = rootView.findViewById(R.id.no_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish(true);
        }
    });

    button = rootView.findViewById(R.id.yes_button);
    button.setOnClickListener(mNextClickL);

    return rootView;
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:18,代码来源:TutorialSnap2Frag.java


示例3: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.tutorial_snaps);

    View button = rootView.findViewById(R.id.no_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish(true);
        }
    });

    button = rootView.findViewById(R.id.yes_button);
    button.setOnClickListener(mNextClickL);

    button = rootView.findViewById(R.id.buy_button);
    button.setOnClickListener(mBuyClickL);

    return rootView;

}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:22,代码来源:TutorialSnapFrag.java


示例4: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.tutorial_main_go);

    View button = rootView.findViewById(R.id.no_button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish(true);
        }
    });

    button = rootView.findViewById(R.id.yes_button);
    button.setOnClickListener(mNextClickL);

    return rootView;
}
 
开发者ID:saltisgood,项目名称:opensnap,代码行数:18,代码来源:TutorialMainFrag.java


示例5: onCreateOptionsMenu

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
boolean onCreateOptionsMenu(Menu menu) {
    final MenuItem item = menu.add(Menu.NONE, android.R.id.button1, Menu.NONE, "");
    MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);

    int theme = ThemeManager.getThemeType(getDialog().getContext());
    if (theme != ThemeManager.LIGHT) {
        theme = ThemeManager.DARK;
    }
    LayoutInflater inflater = LayoutInflater.from(getDialog().getContext(), theme | PreferenceInit.THEME_FLAG);
    View actionView = inflater.inflate(R.layout.preference_widget_switch_screen_bar);
    Switch switchView = (Switch) actionView.findViewById(R.id.switchWidget);
    switchView.setChecked(mChecked);
    switchView.setTextOn(mSwitchOn);
    switchView.setTextOff(mSwitchOff);
    switchView.setOnCheckedChangeListener(mListener);
    MenuItemCompat.setActionView(item, actionView);

    return true;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:21,代码来源:SwitchScreenPreference.java


示例6: getLayoutInflater

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
@Deprecated
public LayoutInflater getLayoutInflater(Bundle savedInstanceState) {
    if (!mShowsDialog) {
        return super.getLayoutInflater(savedInstanceState);
    }
    mDialog = onCreateDialog(savedInstanceState);
    if (mTitle != null) {
        mDialog.setTitle(mTitle);
        mTitle = null;
    }
    switch (mStyle) {
        case STYLE_NO_INPUT:
            mDialog.getWindow().addFlags(
                    WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                            | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
        case STYLE_NO_FRAME:
        case STYLE_NO_TITLE:
            mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    }
    if (mDialog != null) {
        return LayoutInflater.from(mDialog.getContext());
    }
    return LayoutInflater.from(getActivity());
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:26,代码来源:DialogFragment.java


示例7: SimpleExpandableListAdapter

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public SimpleExpandableListAdapter(Context context,
                                   List<? extends Map<String, ?>> groupData, int expandedGroupLayout,
                                   int collapsedGroupLayout, String[] groupFrom, int[] groupTo,
                                   List<? extends List<? extends Map<String, ?>>> childData,
                                   int childLayout, int lastChildLayout, String[] childFrom,
                                   int[] childTo) {
    mGroupData = groupData;
    mExpandedGroupLayout = expandedGroupLayout;
    mCollapsedGroupLayout = collapsedGroupLayout;
    mGroupFrom = groupFrom;
    mGroupTo = groupTo;
    mChildData = childData;
    mChildLayout = childLayout;
    mLastChildLayout = lastChildLayout;
    mChildFrom = childFrom;
    mChildTo = childTo;
    mInflater = LayoutInflater.from(context);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:19,代码来源:SimpleExpandableListAdapter.java


示例8: setCompletionHint

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public void setCompletionHint(CharSequence hint) {
    mHintText = hint;
    if (hint != null) {
        if (mHintView == null) {
            final TextView hintView = (TextView) LayoutInflater.inflate(
                    getContext(), mHintResource).findViewById(
                    android.R.id.text1);
            hintView.setText(mHintText);
            mHintView = hintView;
            mPopup.setPromptView(hintView);
        } else {
            mHintView.setText(hint);
        }
    } else {
        mPopup.setPromptView(null);
        mHintView = null;
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:19,代码来源:AutoCompleteTextView.java


示例9: initForMenu

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public void initForMenu(Context context, MenuBuilder menu) {
    if (mThemeRes != 0) {
        mContext = new ContextThemeWrapper(context, mThemeRes);
        mInflater = LayoutInflater.from(mContext);
    } else if (mContext != null) {
        mContext = context;
        if (mInflater == null) {
            mInflater = LayoutInflater.from(mContext);
        }
    }
    mMenu = menu;
    if (mAdapter != null) {
        mAdapter.notifyDataSetChanged();
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:17,代码来源:ListMenuPresenter.java


示例10: inflate

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public static View inflate(LayoutInflater layoutInflater, AttributeSet attrs, View parent,
                           Fragment fragment) {
    FragmentActivity activity = layoutInflater.getFragmentActivity();
    if (activity != null) {
        return inflate(attrs, parent, activity, fragment);
    }
    Context context = layoutInflater.getContext();
    while (context instanceof ContextWrapper) {
        if (context instanceof FragmentActivity) {
            activity = (FragmentActivity) context;
            break;
        }
        context = ((ContextWrapper) context).getBaseContext();
    }
    if (activity == null) {
        throw new IllegalStateException("Cannot find any reference to FragmentActivity");
    }
    return inflate(attrs, parent, activity, fragment);
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:20,代码来源:_HoloFragmentInflater.java


示例11: onCreateDialog

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	final ViewGroup viewGroup = (ViewGroup)LayoutInflater.from(activity).inflate(R.layout.dialog_game_code, null);

	return new AlertDialog.Builder(activity)
		.setIcon(R.drawable.ic_dialog_alert)
		.setTitle(R.string.dlg_enter_code)
		.setView(viewGroup)
		.setPositiveButton(R.string.dlg_ok, new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface dialog, int whichButton) {
				EditText editText = (EditText)viewGroup.findViewById(R.id.code);
				engine.game.unprocessedGameCode = editText.getText().toString();
				activity.tracker.sendEventAndFlush(Common.GA_CATEGORY, "CodeEntered", engine.game.unprocessedGameCode, 0);
			}
		})
		.setNegativeButton(R.string.dlg_cancel, null)
		.create();
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:20,代码来源:GameCodeDialogFragment.java


示例12: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	viewGroup = (ViewGroup)inflater.inflate(R.layout.fragment_select_episode, container, false);

	images[0] = (ImageView)viewGroup.findViewById(R.id.image_1);
	images[1] = (ImageView)viewGroup.findViewById(R.id.image_2);
	currentImageIdx = 0;

	((Button)viewGroup.findViewById(R.id.back)).setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			activity.soundManager.playSound(SoundManager.SOUND_BTN_PRESS);
			activity.showFragment(activity.menuFragment);
		}
	});

	((Button)viewGroup.findViewById(R.id.kontinue)).setOnClickListener(onContinueClick);
	images[0].setOnClickListener(onContinueClick);
	images[1].setOnClickListener(onContinueClick);

	updateImages();
	return viewGroup;
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:24,代码来源:SelectEpisodeFragment.java


示例13: TimePickerDialog

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public TimePickerDialog(Context context, int theme,
        OnTimeSetListener callBack, int hourOfDay, int minute,
        boolean is24HourView) {
    super(context, theme);
    mCallback = callBack;
    mInitialHourOfDay = hourOfDay;
    mInitialMinute = minute;
    mIs24HourView = is24HourView;
    setIcon(0);
    setTitle(R.string.time_picker_dialog_title);
    Context themeContext = getContext();
    setButton(DialogInterface.BUTTON_POSITIVE,
            themeContext.getText(R.string.date_time_set), this);
    setButton(DialogInterface.BUTTON_NEGATIVE,
            themeContext.getText(android.R.string.cancel),
            (OnClickListener) null);
    View view = LayoutInflater.inflate(themeContext,
            R.layout.time_picker_dialog);
    setView(view);
    mTimePicker = (TimePicker) view.findViewById(R.id.timePicker);
    mTimePicker.setIs24HourView(mIs24HourView);
    mTimePicker.setCurrentHour(mInitialHourOfDay);
    mTimePicker.setCurrentMinute(mInitialMinute);
    mTimePicker.setOnTimeChangedListener(this);
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:26,代码来源:TimePickerDialog.java


示例14: DatePickerDialog

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public DatePickerDialog(Context context, int theme,
        OnDateSetListener callBack, int year, int monthOfYear,
        int dayOfMonth) {
    super(context, theme);
    mCallBack = callBack;
    mCalendar = Calendar.getInstance();
    setButton(DialogInterface.BUTTON_POSITIVE,
            getContext().getText(R.string.date_time_done), this);
    setButton(DialogInterface.BUTTON_NEGATIVE,
            getContext().getText(android.R.string.cancel), this);
    setIcon(0);
    LayoutInflater inflater = LayoutInflater.from(getContext());
    View view = inflater.inflate(R.layout.date_picker_dialog, null);
    setView(view);
    mDatePicker = (DatePicker) view.findViewById(R.id.datePicker);
    mDatePicker.init(year, monthOfYear, dayOfMonth, this);
    updateTitle(year, monthOfYear, dayOfMonth);
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:DatePickerDialog.java


示例15: SimpleExpandableListAdapter

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public SimpleExpandableListAdapter(Context context,
        List<? extends Map<String, ?>> groupData, int expandedGroupLayout,
        int collapsedGroupLayout, String[] groupFrom, int[] groupTo,
        List<? extends List<? extends Map<String, ?>>> childData,
        int childLayout, int lastChildLayout, String[] childFrom,
        int[] childTo) {
    mGroupData = groupData;
    mExpandedGroupLayout = expandedGroupLayout;
    mCollapsedGroupLayout = collapsedGroupLayout;
    mGroupFrom = groupFrom;
    mGroupTo = groupTo;
    mChildData = childData;
    mChildLayout = childLayout;
    mLastChildLayout = lastChildLayout;
    mChildFrom = childFrom;
    mChildTo = childTo;
    mInflater = LayoutInflater.from(context);
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:19,代码来源:SimpleExpandableListAdapter.java


示例16: initForMenu

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public void initForMenu(Context context, MenuBuilder menu) {
    if (mThemeRes != 0) {
        mContext = new ContextThemeWrapperPlus(context, mThemeRes);
        mInflater = LayoutInflater.from(mContext);
    } else if (mContext != null) {
        mContext = context;
        if (mInflater == null) {
            mInflater = LayoutInflater.from(mContext);
        }
    }
    mMenu = menu;
    if (mAdapter != null) {
        mAdapter.notifyDataSetChanged();
    }
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:17,代码来源:ListMenuPresenter.java


示例17: inflate

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public static View inflate(LayoutInflater layoutInflater, AttributeSet attrs, View parent,
        Fragment fragment) {
    FragmentActivity activity = layoutInflater.getFragmentActivity();
    if (activity != null) {
        return inflate(attrs, parent, activity, fragment);
    }
    Context context = layoutInflater.getContext();
    while (context instanceof ContextWrapper) {
        if (context instanceof FragmentActivity) {
            activity = (FragmentActivity) context;
            break;
        }
        context = ((ContextWrapper) context).getBaseContext();
    }
    if (activity == null) {
        throw new IllegalStateException("Cannot find any reference to FragmentActivity");
    }
    return inflate(attrs, parent, activity, fragment);
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:20,代码来源:_HoloFragmentInflater.java


示例18: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    mDrawerListView = (ListView) inflater.inflate(
            R.layout.fragment_navigation_drawer, container, false);
    mDrawerListView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(android.widget.AdapterView<?> parent, View view, int position, long id) {
            selectItem(position);
        }
    });
    mDrawerListView.setAdapter(new ArrayAdapter<String>(
            getSupportActionBar().getThemedContext(),
            android.R.layout.simple_list_item_1,
            android.R.id.text1,
            new String[]{
                    getString(R.string.title_section1),
                    getString(R.string.title_section2),
                    getString(R.string.title_section3),
            }));
    mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
    return mDrawerListView;
}
 
开发者ID:wuyingren,项目名称:WhatsAnnoyProject,代码行数:24,代码来源:NavigationDrawerFragment.java


示例19: onCreateView

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {       
View view = inflater.inflate(R.layout.fragment_vertretung, container, false);

appContext = getActivity().getApplicationContext();
startActivity = (StartActivity) getActivity();

// Restore preferences
      settings = PreferenceManager.getDefaultSharedPreferences(appContext);
      list = (ListView) view.findViewById(R.id.listView1);
      klassen = (Spinner) view.findViewById(R.id.spinner1);
      txtStand = (TextView) view.findViewById(R.id.txtStand);
      pBar = (ProgressBar) view.findViewById(R.id.progressBar1);
      
      listadapter = new VertretungAdapter(startActivity);
list.setAdapter(listadapter);

new LoadClassesTask().execute();

// Inflate the layout for this fragment
      return view;
  }
 
开发者ID:johan12345,项目名称:ls-vertretungsplan,代码行数:23,代码来源:VertretungFragment.java


示例20: DatePickerDialog

import org.holoeverywhere.LayoutInflater; //导入依赖的package包/类
public DatePickerDialog(Context context, int theme,
        OnDateSetListener callBack, int year, int monthOfYear,
        int dayOfMonth) {
    super(context, theme);
    mCallBack = callBack;
    mCalendar = Calendar.getInstance();
    setButton(DialogInterface.BUTTON_POSITIVE,
            getContext().getText(R.string.date_time_done), this);
    setButton(DialogInterface.BUTTON_NEGATIVE,
            getContext().getText(android.R.string.cancel), this);
    setIcon(0);
    LayoutInflater inflater = LayoutInflater.from(context);
    View view = inflater.inflate(R.layout.date_picker_dialog, null);
    setView(view);
    mDatePicker = (DatePicker) view.findViewById(R.id.datePicker);
    mDatePicker.init(year, monthOfYear, dayOfMonth, this);
    updateTitle(year, monthOfYear, dayOfMonth);
}
 
开发者ID:antonyt,项目名称:TflTravelAlerts,代码行数:19,代码来源:DatePickerDialog.java



注:本文中的org.holoeverywhere.LayoutInflater类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SnmpMibSubRequest类代码示例发布时间:2022-05-22
下一篇:
Java ComputationGraph类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap