当前位置: 首页>>代码示例>>Java>>正文


Java TabHost.setOnTabChangedListener方法代码示例

本文整理汇总了Java中android.widget.TabHost.setOnTabChangedListener方法的典型用法代码示例。如果您正苦于以下问题:Java TabHost.setOnTabChangedListener方法的具体用法?Java TabHost.setOnTabChangedListener怎么用?Java TabHost.setOnTabChangedListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.TabHost的用法示例。


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

示例1: onCreate

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setResult(RESULT_CANCELED);
  setContentView(R.layout.folder_picker);

  TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost);
  tabHost.setup();
  
  tabHost.addTab(tabHost.newTabSpec("t1").setIndicator(getString(R.string.folder_new)).setContent(this));
  tabHost.addTab(tabHost.newTabSpec("t2").setIndicator(getString(R.string.folder_existing)).setContent(this));
  tabHost.setCurrentTab(0);
  tabHost.setOnTabChangedListener(this);

  onTabChanged(null);

  mIconPicker = new IconPicker(this, true);
  mIconSelect = (ImageView) findViewById(R.id.folder_icon);
  mIconSelect.setOnClickListener(this);
}
 
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:21,代码来源:FolderPick.java

示例2: onCreateView

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.activity_my_files, container, false);

    myFileList = (ListView) v.findViewById(R.id.myFileList);
    myFileList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    myFileList.setOnItemClickListener(this);

    allEntities = FileSelectHelper.getFileEntities(FileSelectorActivity.getServerResponse());

    // Init tab host categories {My files}
    tabHostMyFile = (TabHost) v.findViewById(R.id.tabHostMyFiles);
    tabHostMyFile.setup();

    initTabHost(tabHostMyFile, getMyFilesCategories(allEntities));
    tabHostMyFile.setOnTabChangedListener(new MyFilesCategoriesListener());

    myFileList.setAdapter(getArrayAdapterForMyFiles(allEntities, tabHostMyFile.getCurrentTabTag()));

    FileEntity currentEntity = FileSelectorActivity.getCurrentEntity();
    tabHostMyFile.setCurrentTab(currentTab);
    FileSelectorActivity.setCurrentEntity(currentEntity);

    return v;
}
 
开发者ID:SequencingDOTcom,项目名称:RTP-API-Gradle-Maven-Android-File-Selector-Java,代码行数:27,代码来源:MyFileActivity.java

示例3: onCreateView

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState)
{
    super.onCreateView(inflater, container, savedInstanceState);
    
    View v = inflater.inflate(R.layout.result_tabhost_pager, container, false);
	tabHost = (TabHost) v.findViewById(android.R.id.tabhost);
	tabHost.setup();
	tabHost.setOnTabChangedListener(this);
	
	for (int i = 0; i < pagerAdapter.getCount(); i++) {
		TabSpec tab = tabHost.newTabSpec(String.valueOf(i));
		//tab.setIndicator(getActivity().getResources().getStringArray(R.array.result_page_title)[i]);
		tab.setContent(android.R.id.tabcontent);
		    		    		
		View indicator = inflater.inflate(R.layout.tabhost_indicator, null);
		TextView title = (TextView) indicator.findViewById(android.R.id.title);
		title.setText(pagerAdapter.getPageTitle(i));
		tab.setIndicator(indicator);
		tabHost.addTab(tab);
	}

    viewPager = (ExtendedViewPager) v.findViewById(R.id.pager);
    viewPager.setAdapter(pagerAdapter);
    
    viewPager.setOnPageChangeListener(this);
    setCurrentPosition(0);

	scroller = (HorizontalScrollView) v.findViewById(R.id.tabwidget_scrollview);
   	viewPager.setCurrentItem(initPageIndex);
	
    return v;
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:34,代码来源:QoSTestDetailPagerFragment.java

示例4: createView

import android.widget.TabHost; //导入方法依赖的package包/类
private View createView(View v, LayoutInflater inflater, int currentPage) {
	tabHost = (TabHost) v.findViewById(android.R.id.tabhost);
	tabHost.setup();
	tabHost.setOnTabChangedListener(this);
	
	for (int i = 0; i < pagerAdapter.getCount(); i++) {
		TabSpec tab = tabHost.newTabSpec(String.valueOf(i));
		//tab.setIndicator(getActivity().getResources().getStringArray(R.array.result_page_title)[i]);
		tab.setContent(android.R.id.tabcontent);
		    		
		
		View indicator = inflater.inflate(R.layout.tabhost_indicator, null);
		TextView title = (TextView) indicator.findViewById(android.R.id.title);
		title.setText(getActivity().getResources().getStringArray(R.array.result_page_title)[RMBTResultPagerAdapter.RESULT_PAGE_TAB_TITLE_MAP.get(i)]);
		
		if (MAP_INDICATOR_DYNAMIC_VISIBILITY) {
			if (i == RMBTResultPagerAdapter.RESULT_PAGE_MAP) {
				indicator.setVisibility(View.GONE);
			}
		}
		tab.setIndicator(indicator);
		
		tabHost.addTab(tab);
	}
	
	scroller = (HorizontalScrollView) v.findViewById(R.id.tabwidget_scrollview);
	
    viewPager = (ExtendedViewPager) v.findViewById(R.id.pager);
    viewPager.setAdapter(pagerAdapter);
    
    viewPager.setOnPageChangeListener(this);
    setCurrentPosition(currentPage);

    return v;
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:36,代码来源:RMBTResultPagerFragment.java

示例5: setupTabs

import android.widget.TabHost; //导入方法依赖的package包/类
protected void setupTabs()
{
	TabHost tabHost = (TabHost) findViewById(R.id.tabhost);
	tabHost.setup();

	//  get the tab tags.
	mTagHidden = getResources().getString(R.string.hidden_tab);
	mTagFile = getResources().getString(R.string.file_tab);
	mTagAnnotate = getResources().getString(R.string.annotate_tab);
	mTagPages = getResources().getString(R.string.pages_tab);

	//  first tab is and stays hidden.
	//  when the search tab is selected, we programmatically "select" this hidden tab
	//  which results in NO tabs appearing selected in this tab host.
	setupTab(tabHost, mTagHidden, R.id.hiddenTab, R.layout.tab);
	tabHost.getTabWidget().getChildTabViewAt(0).setVisibility(View.GONE);

	//  these tabs are shown.
	setupTab(tabHost, mTagFile, R.id.fileTab, R.layout.tab_left);
	setupTab(tabHost, mTagAnnotate, R.id.annotateTab, R.layout.tab);
	setupTab(tabHost, mTagPages, R.id.pagesTab, R.layout.tab_right);

	//  start by showing the edit tab
	tabHost.setCurrentTabByTag(mTagFile);

	tabHost.setOnTabChangedListener(this);
}
 
开发者ID:ArtifexSoftware,项目名称:mupdf-android-viewer-nui,代码行数:28,代码来源:DocActivityView.java

示例6: onActivityCreated

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mTextViewTitleExample.setText(R.string.criteria_stateelement_ex1_title);
    mTextViewDescriptionExample.setText(R.string.criteria_stateelement_ex1_description);
    mTextViewTitleExempleAxsYes.setText(R.string.criteria_accessible_example);
    mTextViewOptionEnabled.setText(getString(R.string.criteria_template_option_tb));

    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    LinearLayout myView = (LinearLayout) inflater.inflate(R.layout.exstateelmts1_frag, null);
    mFrameLayoutExampleAxsYes.addView(myView);

    mTextViewTitleExempleAxsNo.setText(R.string.criteria_not_accessible_example);

    LinearLayout myView2 = (LinearLayout) inflater.inflate(R.layout.exstateelmts1_frag, null);

    mFrameLayoutExampleAxsNo.addView(myView2);

    //HostYesAxs
    String[] tabslabs = new String[2];
    tabslabs[0] = getString(R.string.criteria_stateelement_ex1_public);
    tabslabs[1] = getString(R.string.criteria_stateelement_ex1_private);
    TabHost hostYes = initTabHost(myView);
    hostYes.setOnTabChangedListener(new TabHostListener(hostYes, tabslabs));
   setContentDescription(hostYes, tabslabs);

    for (int i = 0; i < hostYes.getTabWidget().getChildCount(); i++)
        hostYes.getTabWidget().getChildAt(i).setBackgroundResource(R.drawable.tab_selector);

    //HostNoAxs
    TabHost hostNo = initTabHost(myView2);
    for (int i = 0; i < hostNo.getTabWidget().getChildCount(); i++)
        hostNo.getTabWidget().getChildAt(i).setBackgroundResource(R.drawable.tab_selector);

}
 
开发者ID:Orange-OpenSource,项目名称:m-dan,代码行数:37,代码来源:ExStateElmts1Fragment.java

示例7: onCreate

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.cfg_strectch_editor);
  mImg = (Bitmap) getIntent().getParcelableExtra("img");

  mStretchRect = getExtra(KEY_STRETCH);
  mPaddingRect = getExtra(KEY_PADDING);

  mTabHost = (TabHost) findViewById(android.R.id.tabhost);
  mTabHost.setup();
  mPager = (SwipePager) findViewById(R.id.swipeTabs);

  mTabHost.addTab(mTabHost.newTabSpec("t1").setIndicator(getString(R.string.npe_stretch)).setContent(this));
  mTabHost.addTab(mTabHost.newTabSpec("t2").setIndicator(getString(R.string.npe_padding)).setContent(this));
  mTabHost.setOnTabChangedListener(this);
  mPager.setOnPageChangeListener(this);
  mPager.setDisplayChild(0);

  
  mNinePatchView = (NinePatchView) findViewById(R.id.prewiewHolder);
  mNinePatchView.setBitmap(mImg);
  mNinePatchView.setDim(mStretchRect);
  LayoutParams lp = mNinePatchView.getLayoutParams();
  lp.height = Math.max(lp.height, mImg.getHeight() * 3 / 2);

  mStretchView = setRect(R.id.stretch_rect, mStretchRect, 2);
  setRect(R.id.padding_rect, mPaddingRect, 3);
}
 
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:30,代码来源:NinePatchEditor.java

示例8: onCreate

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        backGround = (LinearLayout) findViewById(R.id.background);
        getSupportActionBar().hide();

        tabHost = (TabHost)findViewById(R.id.tab_host);
        tabHost.setup();
        tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
            @Override
            public void onTabChanged(String tabId) {
                FragmentTransaction fragmentTransaction = getFragmentManager()
                        .beginTransaction();
                if(TextUtils.equals("first",tabId)){
                    //
                    contents = new homeFragement();
                }else if(TextUtils.equals("second",tabId)){
                    //
                    contents = new downloadFragment();
                }
                fragmentTransaction.replace(android.R.id.tabcontent, contents,"frag");
                fragmentTransaction.commit();
            }
        });
        tabHost.addTab(tabHost.newTabSpec("first").setIndicator("主页").setContent(new TabFactory(this)));
        tabHost.addTab(tabHost.newTabSpec("second").setIndicator("下载").setContent(new TabFactory(this)));

//        背景图片透明度
        backGround.getBackground().setAlpha(100);

    }
 
开发者ID:webhood,项目名称:ThisBili,代码行数:33,代码来源:MainActivity.java

示例9: onCreateView

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    rootView= inflater.inflate(R.layout.fragment_first_aid, container, false);



    viewPager = (ViewPager) rootView.findViewById(R.id.view_pager);
    List<Fragment> listFragments = new ArrayList<Fragment>();
    listFragments.add(new BurnsFragment());
    listFragments.add(new CprFragment());
    listFragments.add(new Fragment3());

    viewPager.setOffscreenPageLimit(listFragments.size());

    MyFragmentPagerAdapter myFragmentPagerAdapter = new MyFragmentPagerAdapter(getFragmentManager(),listFragments);
    viewPager.setAdapter(myFragmentPagerAdapter);
    viewPager.setOnPageChangeListener(this);
    tabHost = (TabHost) rootView.findViewById(R.id.tabHost);
    tabHost.setup();

    String[] tabNames = {"Burns", "CPR", "Fire"};
    for(int i=0; i<tabNames.length; i++){
        TabHost.TabSpec tabSpec;
        tabSpec = tabHost.newTabSpec(tabNames[i]);
        tabSpec.setIndicator(tabNames[i]);
        tabSpec.setContent(new FakeContent(getActivity().getApplicationContext()));
        tabHost.addTab(tabSpec);
    }
    tabHost.setOnTabChangedListener(this);

    return rootView;
}
 
开发者ID:DamianPilot382,项目名称:Health-App,代码行数:34,代码来源:FirstAidFragment.java

示例10: onCreateView

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.activity_sample_files, container, false);

    sampleFileList = (ListView) v.findViewById(R.id.sampleFileList);
    sampleFileList.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    sampleFileList.setOnItemClickListener(this);

    allEntities = FileSelectHelper.getFileEntities(FileSelectorActivity.getServerResponse());

    // Init tab host categories { Sample files}
    tabHostSampleFile = (TabHost) v.findViewById(R.id.tabHostSampleFiles);
    tabHostSampleFile.setup();

    initTabHost(tabHostSampleFile, getSampleFilesSubCategories());
    tabHostSampleFile.setOnTabChangedListener(new SampleFilesCategoriesListener());

    ArrayAdapter<SpannableString> listAdapter = null;
    if(tabHostSampleFile.getCurrentTabTag().equals(FileSelectHelper.ATTR_SAMPLE_ALL)) {
        listAdapter = getArrayAdapterForSampleFiles(allEntities, null);
    } else {
        listAdapter = getArrayAdapterForSampleFiles(allEntities, tabHostSampleFile.getCurrentTabTag());
    }
    sampleFileList.setAdapter(listAdapter);

    FileEntity currentEntity = FileSelectorActivity.getCurrentEntity();
    tabHostSampleFile.setCurrentTab(currentTab);
    FileSelectorActivity.setCurrentEntity(currentEntity);

    return v;
}
 
开发者ID:SequencingDOTcom,项目名称:RTP-API-Gradle-Maven-Android-File-Selector-Java,代码行数:33,代码来源:SampleFileActivity.java

示例11: FileGalleryPreviewDialog

import android.widget.TabHost; //导入方法依赖的package包/类
public FileGalleryPreviewDialog(Context context) {
	super(context);
	
	View dialogView = getLayoutInflater().inflate(R.layout.label_dialog, null);
	setView(dialogView);
	
	setButton(DialogInterface.BUTTON_POSITIVE, getContext().getResources().getString(R.string.confirm_dialog_button),
			new OnClickListener() {
				
				@Override
				public void onClick(DialogInterface dialog, int which) {
					// do nothing
				}
			});
	
	tabHost = (TabHost) dialogView.findViewById(R.id.label_tabhost);
	tabHost.setup();
	
	tabHost.setOnTabChangedListener(new OnTabChangeListener() {
		
		@Override
		public void onTabChanged(String tabId) {
			// Hide/show video preview so it's not visible in background on tab change
			if ("video_preview".equals(tabId)) {
				videoView.setVisibility(View.VISIBLE);
				videoView.start();
			} else {
				if (videoView != null) {
					videoView.setVisibility(View.GONE);
				}
			}
		}
	});
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:35,代码来源:FileGalleryPreviewDialog.java

示例12: LabelDialog

import android.widget.TabHost; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
public LabelDialog(Context context) {
	super(context);
	
	tabs = new ArrayList<String>();
	tabSpecs = new ArrayList<TabHost.TabSpec>();
	
	setButton(DialogInterface.BUTTON_NEGATIVE, getContext().getResources().getString(R.string.cancel_dialog_button),
			new OnClickListener() {
		
		@Override
		public void onClick(DialogInterface dialog, int which) {
			// User cancelled the dialog
		}
	});

	View labelDialogView = getLayoutInflater().inflate(R.layout.label_dialog, null);
	setView(labelDialogView);
	
	tabHost = (TabHost) labelDialogView.findViewById(R.id.label_tabhost);
	tabHost.setup();
	// Hide soft keyboard on tab change
	tabHost.setOnTabChangedListener(new OnTabChangeListener() {
		
		@Override
		public void onTabChanged(String tabId) {
			handleTabChange(tabId);
		}
	});
}
 
开发者ID:FAIMS,项目名称:faims-android,代码行数:31,代码来源:LabelDialog.java

示例13: onCreateView

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
 public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState)
 {
     if (savedInstanceState != null && savedInstanceState.containsKey(BUNDLE_QOS_RESULTS)) {
     	try {
	setQoSResult(new QoSServerResultCollection(new JSONArray(savedInstanceState.getString(BUNDLE_QOS_RESULTS))));
	setDetailType(DetailType.valueOf(savedInstanceState.getString(BUNDLE_DETAIL_TYPE)));
} catch (JSONException e) {
	//e.printStackTrace();
}
     }
     //DetailType detailType = DetailType.valueOf(args.getString(ARG_DETAIL_TYPE));
     pagerAdapter = new QoSCategoryPagerAdapter((RMBTMainActivity) getActivity(), handler, results);
     
     View v = inflater.inflate(R.layout.result_tabhost_pager, container, false);
 	tabHost = (TabHost) v.findViewById(android.R.id.tabhost);
 	tabHost.setup();
 	tabHost.setOnTabChangedListener(this);
 	
 	for (int i = 0; i < pagerAdapter.getCount(); i++) {
 		TabSpec tab = tabHost.newTabSpec(String.valueOf(i));
 		//tab.setIndicator(getActivity().getResources().getStringArray(R.array.result_page_title)[i]);
 		tab.setContent(android.R.id.tabcontent);
 		    		    		
 		View indicator = inflater.inflate(R.layout.tabhost_indicator, null);
 		TextView title = (TextView) indicator.findViewById(android.R.id.title);
 		title.setText(pagerAdapter.getPageTitle(i));
 		tab.setIndicator(indicator);
 		tabHost.addTab(tab);
 	}

     viewPager = (ExtendedViewPager) v.findViewById(R.id.pager);
     viewPager.setAdapter(pagerAdapter);
     
     viewPager.setOnPageChangeListener(this);
     setCurrentPosition(0);

 	scroller = (HorizontalScrollView) v.findViewById(R.id.tabwidget_scrollview);
 	

     if (initPosition != null) {
     	viewPager.setCurrentItem(initPosition);
     }
 	
     return v;
 }
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:47,代码来源:QoSCategoryPagerFragment.java

示例14: onCreate

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    activity=this;
    
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    initialLoad();

    final TabHost tabHost = getTabHost();

    setupAccountsTab(tabHost);
    setupBlotterTab(tabHost);
    setupBudgetsTab(tabHost);
    setupReportsTab(tabHost);

    MyPreferences.StartupScreen screen = MyPreferences.getStartupScreen(this);
    tabHost.setCurrentTabByTag(screen.tag);

    tabHost.setOnTabChangedListener(this);

}
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:24,代码来源:MainActivity.java

示例15: onFinishInflate

import android.widget.TabHost; //导入方法依赖的package包/类
@Override
protected void onFinishInflate() {
    mTabHost = (TabHost)findViewById(R.id.emoji_category_tabhost);
    mTabHost.setup();
    for (final EmojiCategory.CategoryProperties properties
            : mEmojiCategory.getShownCategories()) {
        addTab(mTabHost, properties.mCategoryId);
    }
    mTabHost.setOnTabChangedListener(this);
    final TabWidget tabWidget = mTabHost.getTabWidget();
    tabWidget.setStripEnabled(mCategoryIndicatorEnabled);
    if (mCategoryIndicatorEnabled) {
        // On TabWidget's strip, what looks like an indicator is actually a background.
        // And what looks like a background are actually left and right drawables.
        tabWidget.setBackgroundResource(mCategoryIndicatorDrawableResId);
        tabWidget.setLeftStripDrawable(mCategoryIndicatorBackgroundResId);
        tabWidget.setRightStripDrawable(mCategoryIndicatorBackgroundResId);
    }

    mEmojiPalettesAdapter = new EmojiPalettesAdapter(mEmojiCategory, this);

    mEmojiPager = (ViewPager)findViewById(R.id.emoji_keyboard_pager);
    mEmojiPager.setAdapter(mEmojiPalettesAdapter);
    mEmojiPager.setOnPageChangeListener(this);
    mEmojiPager.setOffscreenPageLimit(0);
    mEmojiPager.setPersistentDrawingCache(PERSISTENT_NO_CACHE);
    mEmojiLayoutParams.setPagerProperties(mEmojiPager);

    mEmojiCategoryPageIndicatorView =
            (EmojiCategoryPageIndicatorView)findViewById(R.id.emoji_category_page_id_view);
    mEmojiCategoryPageIndicatorView.setColors(
            mCategoryPageIndicatorColor, mCategoryPageIndicatorBackground);
    mEmojiLayoutParams.setCategoryPageIdViewProperties(mEmojiCategoryPageIndicatorView);

    setCurrentCategoryId(mEmojiCategory.getCurrentCategoryId(), true /* force */);

    final LinearLayout actionBar = (LinearLayout)findViewById(R.id.emoji_action_bar);
    mEmojiLayoutParams.setActionBarProperties(actionBar);

    // deleteKey depends only on OnTouchListener.
    mDeleteKey = (ImageButton)findViewById(R.id.emoji_keyboard_delete);
    mDeleteKey.setBackgroundResource(mFunctionalKeyBackgroundId);
    mDeleteKey.setTag(Constants.CODE_DELETE);
    mDeleteKey.setOnTouchListener(mDeleteKeyOnTouchListener);

    // {@link #mAlphabetKeyLeft}, {@link #mAlphabetKeyRight, and spaceKey depend on
    // {@link View.OnClickListener} as well as {@link View.OnTouchListener}.
    // {@link View.OnTouchListener} is used as the trigger of key-press, while
    // {@link View.OnClickListener} is used as the trigger of key-release which does not occur
    // if the event is canceled by moving off the finger from the view.
    // The text on alphabet keys are set at
    // {@link #startEmojiPalettes(String,int,float,Typeface)}.
    mAlphabetKeyLeft = (TextView)findViewById(R.id.emoji_keyboard_alphabet_left);
    mAlphabetKeyLeft.setBackgroundResource(mFunctionalKeyBackgroundId);
    mAlphabetKeyLeft.setTag(Constants.CODE_ALPHA_FROM_EMOJI);
    mAlphabetKeyLeft.setOnTouchListener(this);
    mAlphabetKeyLeft.setOnClickListener(this);
    mAlphabetKeyRight = (TextView)findViewById(R.id.emoji_keyboard_alphabet_right);
    mAlphabetKeyRight.setBackgroundResource(mFunctionalKeyBackgroundId);
    mAlphabetKeyRight.setTag(Constants.CODE_ALPHA_FROM_EMOJI);
    mAlphabetKeyRight.setOnTouchListener(this);
    mAlphabetKeyRight.setOnClickListener(this);
    mSpacebar = findViewById(R.id.emoji_keyboard_space);
    mSpacebar.setBackgroundResource(mSpacebarBackgroundId);
    mSpacebar.setTag(Constants.CODE_SPACE);
    mSpacebar.setOnTouchListener(this);
    mSpacebar.setOnClickListener(this);
    mEmojiLayoutParams.setKeyProperties(mSpacebar);
    mSpacebarIcon = findViewById(R.id.emoji_keyboard_space_icon);
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:71,代码来源:EmojiPalettesView.java


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