List of usage examples for android.view Gravity END
int END
To view the source code for android.view Gravity END.
Click Source Link
From source file:org.odk.collect.android.fragments.AppListFragment.java
@Override public void setUserVisibleHint(boolean isVisibleToUser) { if (!isVisibleToUser) { // close the drawer if open if (drawerLayout != null && drawerLayout.isDrawerOpen(Gravity.END)) { drawerLayout.closeDrawer(Gravity.END); }// w w w . j a v a 2 s . co m } }
From source file:com.facebook.react.views.drawer.ReactDrawerLayoutManager.java
@Override public @Nullable Map getExportedViewConstants() { return MapBuilder.of("DrawerPosition", MapBuilder.of("Left", Gravity.START, "Right", Gravity.END)); }
From source file:com.jsw.MngProductDatabase.Fragments.ListProduct_Fragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mList = getListView();// www. j a va 2 s. co m setListAdapter(mAdapter); mList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int i, long l) { Bundle potatoe = new Bundle(); potatoe.putParcelable(PRODUCT_KEY, (Product) parent.getItemAtPosition(i)); mCallback.showManageProduct(potatoe); } }); mList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) { mItemParent = adapterView; mItemPos = i; popup = new PopupMenu(getContext(), view); popup.setGravity(Gravity.END); popup.getMenuInflater().inflate(R.menu.delete_menu, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { p = (Product) mItemParent.getItemAtPosition(mItemPos); mCallback.showDeletePopUp(p); return true; } }); popup.show(); return true; } }); mFab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mCallback.showManageProduct(null); } }); mPresenter.getAllProducts(); }
From source file:azad.hallaji.farzad.com.masirezendegi.ExplainMoshaver.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_explain_moshaver); Fabric.with(this, new Crashlytics()); alagestarmoshaver = (ImageView) findViewById(R.id.alagestarmoshaver); if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { placeid = ""; } else {/*from ww w. j a v a 2 s . co m*/ placeid = extras.getString("placeid"); } } else { placeid = (String) savedInstanceState.getSerializable("placeid"); } ImageView imageView1 = (ImageView) findViewById(R.id.backButton); imageView1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(ExplainMoshaver.this, PageMoshaverin.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(intent); } }); final DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); ImageView imageView = (ImageView) findViewById(R.id.menuButton); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { drawer.openDrawer(Gravity.END); } }); if (GlobalVar.getUserType().equals("adviser") || GlobalVar.getUserType().equals("user")) { Menu nav_Menu = navigationView.getMenu(); nav_Menu.findItem(R.id.nav_marakez).setVisible(true); nav_Menu.findItem(R.id.nav_profile).setVisible(true); nav_Menu.findItem(R.id.nav_login).setVisible(false); nav_Menu.findItem(R.id.nav_moshaverin).setVisible(true); nav_Menu.findItem(R.id.nav_porseshha).setVisible(true); nav_Menu.findItem(R.id.nav_logout).setVisible(true); } else { Menu nav_Menu = navigationView.getMenu(); nav_Menu.findItem(R.id.nav_marakez).setVisible(true); nav_Menu.findItem(R.id.nav_profile).setVisible(false); nav_Menu.findItem(R.id.nav_login).setVisible(true); nav_Menu.findItem(R.id.nav_moshaverin).setVisible(true); nav_Menu.findItem(R.id.nav_porseshha).setVisible(true); nav_Menu.findItem(R.id.nav_logout).setVisible(false); } userimg = (ImageView) findViewById(R.id.adviser_image); name_moshaver_textview = (TextView) findViewById(R.id.name_moshaver_textview); //taxassose_moshaver_textview =(TextView) findViewById(R.id.taxassose_moshaver_textview); code_moshaver_textview = (TextView) findViewById(R.id.code_moshaver_textview); if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if (extras == null) { adviseridm = "0"; } else { adviseridm = extras.getString("adviserid"); } } else { adviseridm = (String) savedInstanceState.getSerializable("adviserid"); } //Toast.makeText(getApplicationContext(), "+"+adviseridm+"+", Toast.LENGTH_LONG).show(); if (isOnline()) { //requestData(); postgetData(); //Log.i("Lieseesene",License); ImageView imageView2 = (ImageView) findViewById(R.id.adviser_about_img); imageView2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //requestDataa(); if (GlobalVar.getUserType().equals("adviser") || GlobalVar.getUserType().equals("user")) { Intent intent3 = new Intent(ExplainMoshaver.this, PageRezerv.class); intent3.putExtra("adviseridm", adviseridm); intent3.putExtra("placeid", placeid); intent3.putExtra("namemoshaver", namemoshaver); startActivity(intent3); } else { Toast.makeText(getApplicationContext(), " ", Toast.LENGTH_LONG).show(); } } }); // // final ImageView alagestarmarkaz = (ImageView)findViewById(R.id.alagestarmarkaz); alagestarmoshaver.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Log.i("sxascsdcpsdcpsdcpsdc","[sxascsdcpsdcpsdcpsdc"+alagestarmarkaz.getResources()); if (GlobalVar.getUserType().equals("adviser") || GlobalVar.getUserType().equals("user")) { setAlage(); //Log.i("sxascsdcpsdcpsdcpsdc","[sxascsdcp2sdcpsdcpsdc"+hanyayo); } else { Toast.makeText(getApplicationContext(), " ", Toast.LENGTH_LONG).show(); } } }); ImageView adviser_reserve_img = (ImageView) findViewById(R.id.adviser_reserve_img); adviser_reserve_img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final LinearLayout darbareyehuseyin = (LinearLayout) findViewById(R.id.darbareyehuseyin); darbareyehuseyin.setVisibility(View.VISIBLE); TextView textTagsHusseyin = (TextView) findViewById(R.id.textTagsHusseyin); try { textTagsHusseyin.setText(Tagggggggs); ImageView closeafzundanejavab = (ImageView) findViewById(R.id.closeinvisibleimag); closeafzundanejavab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { darbareyehuseyin.setVisibility(View.GONE); } }); } catch (Exception e) { textTagsHusseyin.setText(""); } } }); } else { Toast.makeText(getApplicationContext(), "Network isn't available", Toast.LENGTH_LONG).show(); } }
From source file:com.ymt.demo1.plates.knowledge.KnowledgeMainActivity.java
protected void initTitle() { final MyTitle title = (MyTitle) findViewById(R.id.my_title); // title.setTitleStyle(MyTitle.TitleStyle.RIGHT_ICON_L_R); //todo ? ?UI//from w w w . j a v a 2s . c o m title.setTitleStyle(MyTitle.TitleStyle.RIGHT_ICON_L); title.setOnLeftActionClickListener(new MyTitle.OnLeftActionClickListener() { @Override public void onClick() { finish(); } }); actionListener = new PopActionListener() { @Override public void onAction(String action) { switch (action) { case "?": Toast.makeText(KnowledgeMainActivity.this, "?", Toast.LENGTH_SHORT).show(); startActivity(new Intent(KnowledgeMainActivity.this, RecentViewKnowledgeActivity.class)); break; case "": Toast.makeText(KnowledgeMainActivity.this, "", Toast.LENGTH_SHORT).show(); startActivity(new Intent(KnowledgeMainActivity.this, RecentUploadActivity.class)); break; case "": Toast.makeText(KnowledgeMainActivity.this, "", Toast.LENGTH_SHORT).show(); startActivity(new Intent(KnowledgeMainActivity.this, DownloadRankActivity.class)); break; default: break; } } @Override public void onDismiss() { } }; title.setOnRightActionClickListener(new MyTitle.OnRightActionClickListener() { @Override public void onRightLClick() { startActivity(new Intent(KnowledgeMainActivity.this, FullSearchActivity.class)); } @Override public void onRightRClick() { PopActionUtil popActionUtil = PopActionUtil.getInstance(KnowledgeMainActivity.this); popActionUtil.setActions(new String[] { "?", "", "" }); PopupWindow popupWindow = popActionUtil.getSimpleTxtPopActionMenu(); popupWindow.showAtLocation(title.getRootView(), Gravity.TOP | Gravity.END, 10, 100); popActionUtil.setActionListener(actionListener); } }); }
From source file:com.afg.MngProductContentProvider.Fragments.ListProduct_Fragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mList = getListView();/* w ww . j ava2 s. c om*/ setListAdapter(mAdapter); mList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int i, long l) { Bundle potatoe = new Bundle(); potatoe.putParcelable(PRODUCT_KEY, (Product) parent.getItemAtPosition(i)); mCallback.showManageProduct(potatoe); } }); mList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) { mItemParent = adapterView; mItemPos = i; popup = new PopupMenu(getContext(), view); popup.setGravity(Gravity.END); popup.getMenuInflater().inflate(R.menu.delete_menu, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { p = (Product) mItemParent.getItemAtPosition(mItemPos); mCallback.showDeletePopUp(p); return true; } }); popup.show(); return true; } }); mFab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mCallback.showManageProduct(null); } }); }
From source file:com.QuarkLabs.BTCeClient.fragments.OrdersBookFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setHasOptionsMenu(true);// w w w . j a v a 2 s.c o m @SuppressLint("InflateParams") View v = inflater.inflate(R.layout.fragment_ordersbook, container, false); mAsksList = (ListView) v.findViewById(R.id.asks); mBidsList = (ListView) v.findViewById(R.id.bids); mChartArea = (FrameLayout) v.findViewById(R.id.OrdersBookChart); mLoadingViewAsks = new ProgressBar(getActivity()); mLoadingViewBids = new ProgressBar(getActivity()); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT); lp.gravity = Gravity.CENTER; mLoadingViewAsks.setLayoutParams(lp); mLoadingViewBids.setLayoutParams(lp); ((LinearLayout) mAsksList.getParent()).addView(mLoadingViewAsks); mAsksList.setEmptyView(mLoadingViewAsks); ((LinearLayout) mBidsList.getParent()).addView(mLoadingViewBids); mBidsList.setEmptyView(mLoadingViewBids); ActionBarActivity hostActivity = (ActionBarActivity) getActivity(); hostActivity.getSupportActionBar().setCustomView(mPairsSpinner, new ActionBar.LayoutParams(Gravity.END)); hostActivity.getSupportActionBar().setDisplayShowCustomEnabled(true); return v; }
From source file:org.catrobat.paintroid.ui.TopBar.java
@Override public boolean onTouch(View view, MotionEvent event) { switch (view.getId()) { case R.id.btn_top_undo: onUndoTouch(event);//from w w w. j a v a2s. com return true; case R.id.btn_top_redo: onRedoTouch(event); return true; case R.id.btn_top_color: onColorTouch(event); return true; case R.id.btn_top_layers: mLayerDrawer.openDrawer(Gravity.END); return true; default: return false; } }
From source file:org.odk.collect.android.fragments.AppListFragment.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_SORT: if (drawerLayout.isDrawerOpen(Gravity.END)) { drawerLayout.closeDrawer(Gravity.END); } else {//from w w w. j a v a 2s .c o m Collect.getInstance().hideKeyboard(inputSearch); drawerLayout.openDrawer(Gravity.END); } return true; case MENU_FILTER: if (searchBoxLayout.getVisibility() == View.GONE) { showSearchBox(); } else { hideSearchBox(); } return true; } return super.onOptionsItemSelected(item); }
From source file:com.android.settings.profiles.ProfilesSettings.java
@Override public void onActivityCreated(Bundle savedInstanceState) { // We don't call super.onActivityCreated() here, since it assumes we already set up // Preference (probably in onCreate()), while ProfilesSettings exceptionally set it up in // this method. // On/off switch Activity activity = getActivity();//from ww w . j a va 2 s. com //Switch mActionBarSwitch = new Switch(activity); if (activity instanceof PreferenceActivity) { PreferenceActivity preferenceActivity = (PreferenceActivity) activity; if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { final int padding = activity.getResources() .getDimensionPixelSize(R.dimen.action_bar_switch_padding); mActionBarSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(mActionBarSwitch, new ActionBar.LayoutParams(ActionBar.LayoutParams.WRAP_CONTENT, ActionBar.LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.END)); } } mProfileEnabler = new ProfileEnabler(activity, mActionBarSwitch); // After confirming PreferenceScreen is available, we call super. super.onActivityCreated(savedInstanceState); }