久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='sigRG'><style id='sigRG'><dir id='sigRG'><q id='sigRG'></q></dir></style></legend>
  • <tfoot id='sigRG'></tfoot>

    <small id='sigRG'></small><noframes id='sigRG'>

    1. <i id='sigRG'><tr id='sigRG'><dt id='sigRG'><q id='sigRG'><span id='sigRG'><b id='sigRG'><form id='sigRG'><ins id='sigRG'></ins><ul id='sigRG'></ul><sub id='sigRG'></sub></form><legend id='sigRG'></legend><bdo id='sigRG'><pre id='sigRG'><center id='sigRG'></center></pre></bdo></b><th id='sigRG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='sigRG'><tfoot id='sigRG'></tfoot><dl id='sigRG'><fieldset id='sigRG'></fieldset></dl></div>
      • <bdo id='sigRG'></bdo><ul id='sigRG'></ul>

        如何實現材料指南中描述的全屏對話框?

        How to achieve a full-screen dialog as described in material guidelines?(如何實現材料指南中描述的全屏對話框?)
      1. <i id='8WCtm'><tr id='8WCtm'><dt id='8WCtm'><q id='8WCtm'><span id='8WCtm'><b id='8WCtm'><form id='8WCtm'><ins id='8WCtm'></ins><ul id='8WCtm'></ul><sub id='8WCtm'></sub></form><legend id='8WCtm'></legend><bdo id='8WCtm'><pre id='8WCtm'><center id='8WCtm'></center></pre></bdo></b><th id='8WCtm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8WCtm'><tfoot id='8WCtm'></tfoot><dl id='8WCtm'><fieldset id='8WCtm'></fieldset></dl></div>

        <legend id='8WCtm'><style id='8WCtm'><dir id='8WCtm'><q id='8WCtm'></q></dir></style></legend>
      2. <small id='8WCtm'></small><noframes id='8WCtm'>

          <bdo id='8WCtm'></bdo><ul id='8WCtm'></ul>

          1. <tfoot id='8WCtm'></tfoot>

                  <tbody id='8WCtm'></tbody>
                • 本文介紹了如何實現材料指南中描述的全屏對話框?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  材料指南描述了全屏對話框的行為.

                  Material guidelines describe the behavior of a full-screen dialog.

                  全屏對話框 |對話框 - 材料設計

                  如何在實踐中實現這一目標?

                  How can I achieve this in practice?

                  推薦答案

                  Boss 的回答是正確的,但是缺少問題鏈接上顯示的請求的操作欄.

                  The answer from Boss is correct, but missing the requested action bar as displayed on link in the question.

                  所以,下面的完整示例.

                  So, full example below.

                  對話框片段:

                  public class AKDialogFragment extends DialogFragment {
                  
                  private static final String TAG = "AKDialogFragment";
                  
                  @Override
                  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                  
                      View rootView = inflater.inflate(R.layout.dialog_ak, container, false);
                  
                      Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
                      toolbar.setTitle("Dialog title");
                  
                      ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
                  
                      ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
                      if (actionBar != null) {
                          actionBar.setDisplayHomeAsUpEnabled(true);
                          actionBar.setHomeButtonEnabled(true);
                          actionBar.setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel);
                      }
                      setHasOptionsMenu(true);
                      return rootView;
                  }
                  
                  @NonNull
                  @Override
                  public Dialog onCreateDialog(Bundle savedInstanceState) {
                      Dialog dialog = super.onCreateDialog(savedInstanceState);
                      dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
                      return dialog;
                  }
                  
                  @Override
                  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
                      menu.clear();
                      getActivity().getMenuInflater().inflate(R.menu.menu_ak, menu);
                  }
                  
                  @Override
                  public boolean onOptionsItemSelected(MenuItem item) {
                      int id = item.getItemId();
                  
                      if (id == R.id.action_save) {
                          // handle confirmation button click here
                          return true;
                      } else if (id == android.R.id.home) {
                          // handle close button click here
                          dismiss();
                          return true;
                      }
                  
                      return super.onOptionsItemSelected(item);
                  }
                  }
                  

                  布局 dialog_ak.xml:

                  Layout dialog_ak.xml:

                  <?xml version="1.0" encoding="utf-8"?>
                  <android.support.design.widget.CoordinatorLayout
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:app="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:fitsSystemWindows="true">
                  
                  <android.support.design.widget.AppBarLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:theme="@style/AppTheme.AppBarOverlay">
                  
                      <android.support.v7.widget.Toolbar
                          android:id="@+id/toolbar"
                          android:layout_width="match_parent"
                          android:layout_height="?attr/actionBarSize"
                          android:background="?attr/colorPrimary"
                          app:popupTheme="@style/AppTheme.PopupOverlay"/>
                  
                  </android.support.design.widget.AppBarLayout>
                  
                  <LinearLayout
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:app="http://schemas.android.com/apk/res-auto"
                      xmlns:tools="http://schemas.android.com/tools"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:background="#ffffff"
                      android:orientation="vertical"
                      android:paddingBottom="@dimen/activity_vertical_margin"
                      android:paddingLeft="@dimen/activity_horizontal_margin"
                      android:paddingRight="@dimen/activity_horizontal_margin"
                      android:paddingTop="@dimen/activity_vertical_margin"
                      app:layout_behavior="@string/appbar_scrolling_view_behavior">
                  
                      <TextView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Your content here"/>
                  
                  </LinearLayout>
                  
                  </android.support.design.widget.CoordinatorLayout>
                  

                  菜單 menu_ak.xml

                  Menu menu_ak.xml

                  <menu xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
                    xmlns:tools="http://schemas.android.com/tools">
                    <item
                      android:id="@+id/action_save"
                      android:orderInCategory="100"
                      android:title="Save"
                      app:showAsAction="always"/>
                  </menu>
                  

                  托管活動必須擴展 AppCompatActivity.啟動對話框與老板回答中的相同:

                  Hosting activity must extend AppCompatActivity. Launching dialog is the same as in Boss answer:

                  FragmentManager fragmentManager = getSupportFragmentManager();
                  AKDialogFragment newFragment = new AKDialogFragment();
                  FragmentTransaction transaction = fragmentManager.beginTransaction();
                  transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
                  transaction.add(android.R.id.content, newFragment).addToBackStack(null).commit();
                  

                  我希望它對某人有所幫助.

                  I hope it helps someone.

                  這篇關于如何實現材料指南中描述的全屏對話框?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                          <tbody id='Qp9rG'></tbody>
                        <legend id='Qp9rG'><style id='Qp9rG'><dir id='Qp9rG'><q id='Qp9rG'></q></dir></style></legend>

                      • <i id='Qp9rG'><tr id='Qp9rG'><dt id='Qp9rG'><q id='Qp9rG'><span id='Qp9rG'><b id='Qp9rG'><form id='Qp9rG'><ins id='Qp9rG'></ins><ul id='Qp9rG'></ul><sub id='Qp9rG'></sub></form><legend id='Qp9rG'></legend><bdo id='Qp9rG'><pre id='Qp9rG'><center id='Qp9rG'></center></pre></bdo></b><th id='Qp9rG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Qp9rG'><tfoot id='Qp9rG'></tfoot><dl id='Qp9rG'><fieldset id='Qp9rG'></fieldset></dl></div>
                          <bdo id='Qp9rG'></bdo><ul id='Qp9rG'></ul>
                          <tfoot id='Qp9rG'></tfoot>

                          <small id='Qp9rG'></small><noframes id='Qp9rG'>

                          1. 主站蜘蛛池模板: 欧美精品福利 | 国产一区视频在线 | 亚洲一区二区三区免费视频 | 国产精品久久久久久久久久久久冷 | 国产黄色在线观看 | 亚洲午夜精品在线观看 | 在线视频成人 | 在线免费黄色小视频 | 久久久久久国产 | 日韩在线免费 | 特级毛片www | 国外成人免费视频 | 欧美一区二区三区视频在线观看 | www.4567| 国产精品免费av | 一区二区免费高清视频 | av中文网 | 91在线免费观看网站 | 国产亚洲一区二区三区在线 | 天堂色综合 | 天天成人综合网 | 中文字幕日韩欧美 | 午夜影院视频 | 欧美在线亚洲 | 免费av观看 | 91人人视频在线观看 | 日本精品一区二区三区四区 | 久久久精品一区二区三区 | 久久99精品国产麻豆婷婷 | 国产精品欧美一区二区三区不卡 | 国产精品激情 | 成人福利在线 | 中文字幕在线网 | 欧美日韩一区二区三区在线观看 | 视频一区二区在线观看 | 久久久久久综合 | 亚洲视频一区在线播放 | 在线观看视频你懂得 | 人人艹人人爽 | 91日b| 久久国产精品一区二区 |