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

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

  • <small id='AQ84B'></small><noframes id='AQ84B'>

      <bdo id='AQ84B'></bdo><ul id='AQ84B'></ul>

    1. <tfoot id='AQ84B'></tfoot>
      1. <legend id='AQ84B'><style id='AQ84B'><dir id='AQ84B'><q id='AQ84B'></q></dir></style></legend>
      2. 優(yōu)先創(chuàng)建 NumberPicker 對(duì)話框

        Create NumberPicker dialog in preference(優(yōu)先創(chuàng)建 NumberPicker 對(duì)話框)

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

            <legend id='dBNzd'><style id='dBNzd'><dir id='dBNzd'><q id='dBNzd'></q></dir></style></legend>
            <tfoot id='dBNzd'></tfoot>
              <tbody id='dBNzd'></tbody>

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

                  <bdo id='dBNzd'></bdo><ul id='dBNzd'></ul>
                • 本文介紹了優(yōu)先創(chuàng)建 NumberPicker 對(duì)話框的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在嘗試在我的首選項(xiàng)屏幕中創(chuàng)建一個(gè) NumberPicker 對(duì)話框.我已經(jīng)做了一個(gè):

                  XML 文件:https://github.com/CyanogenMod/android_packages_apps_Trebuchet/blob/cm-10.2/res/layout/number_picker_dialog.xml

                  屬性:https://github.com/CyanogenMod/android_packages_apps_Trebuchet/blob/cm-10.2/res/values/attrs.xml#L158

                  I am trying to create a NumberPicker dialog in my preference screen. I have already made one following this:https://stackoverflow.com/a/5533295/2442638

                  However, for my second dialog, I only want one spinner, so I have adapted the code as follows:

                  import android.content.Context;
                  import android.content.SharedPreferences;
                  import android.content.res.TypedArray;
                  import android.preference.DialogPreference;
                  import android.util.AttributeSet;
                  import android.view.View;
                  import android.widget.NumberPicker;
                  
                  public class SnoozeTPP extends DialogPreference { 
                  
                      private int Minute = 0;
                      private NumberPicker np= null;
                  
                      public static int getMinute(String time) {
                          String[] pieces = time.split(":");
                  
                          return (Integer.parseInt(pieces[1]));
                      }
                  
                      public SnoozeTPP(Context context, AttributeSet attrs) {
                          super(context, attrs);
                  
                          setPositiveButtonText("Set"); 
                          setNegativeButtonText("Cancel"); 
                      }
                  
                      @Override
                      protected View onCreateDialogView() {
                          np = new NumberPicker(getContext());
                  
                          return (np);
                      }
                  
                      @Override
                      protected void onBindDialogView(View v) {
                          super.onBindDialogView(v);
                  
                          np.setMaxValue(60);
                          np.setValue(Minute);
                      }
                  
                      @Override
                      protected void onDialogClosed(boolean positiveResult) {                                                             
                          super.onDialogClosed(positiveResult);
                  
                          if (positiveResult) {
                  
                              Minute = np.getValue();
                  
                              String time = 0 + ":" + String.valueOf(Minute);
                  
                              if (callChangeListener(time)) {
                                  persistString(time);
                              }
                          }
                      }
                  
                      @Override
                      protected Object onGetDefaultValue(TypedArray a, int index) {
                          return (a.getString(index));
                      }
                  
                      @Override
                      protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
                          String time = null;
                  
                          if (restoreValue) {
                              if (defaultValue == null) {
                                  time = getPersistedString("08:00");
                              } else {
                                  time = getPersistedString(defaultValue.toString());
                              }
                          } else {
                              time = defaultValue.toString();
                          }
                  
                          Minute = getMinute(time);
                      }
                  
                  }
                  

                  There are no errors and the dialog pops up correctly, but the layout of it seems to be "messed up" :-). The blue line stretch across the whole dialog instead of just the width of the numbers.

                  The question is - how to set the layout correctly? (I am sure there are lots of other mistakes as well!)

                  Thank you

                  解決方案

                  I solved this by using the CyanogenMod number picker. Java file:

                  https://github.com/CyanogenMod/android_packages_apps_Trebuchet/blob/cm-10.2/src/com/cyanogenmod/trebuchet/preference/NumberPickerPreference.java

                  XML file: https://github.com/CyanogenMod/android_packages_apps_Trebuchet/blob/cm-10.2/res/layout/number_picker_dialog.xml

                  Attributes: https://github.com/CyanogenMod/android_packages_apps_Trebuchet/blob/cm-10.2/res/values/attrs.xml#L158

                  這篇關(guān)于優(yōu)先創(chuàng)建 NumberPicker 對(duì)話框的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  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(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                  Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)
                  <i id='I3w0f'><tr id='I3w0f'><dt id='I3w0f'><q id='I3w0f'><span id='I3w0f'><b id='I3w0f'><form id='I3w0f'><ins id='I3w0f'></ins><ul id='I3w0f'></ul><sub id='I3w0f'></sub></form><legend id='I3w0f'></legend><bdo id='I3w0f'><pre id='I3w0f'><center id='I3w0f'></center></pre></bdo></b><th id='I3w0f'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='I3w0f'><tfoot id='I3w0f'></tfoot><dl id='I3w0f'><fieldset id='I3w0f'></fieldset></dl></div>

                    <tfoot id='I3w0f'></tfoot>
                      <bdo id='I3w0f'></bdo><ul id='I3w0f'></ul>

                            <tbody id='I3w0f'></tbody>

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

                          <legend id='I3w0f'><style id='I3w0f'><dir id='I3w0f'><q id='I3w0f'></q></dir></style></legend>
                            主站蜘蛛池模板: 色啪网| 国产精品69毛片高清亚洲 | 国产中的精品av涩差av | 国产精品中文字幕在线播放 | 国产成人精品一区二区三区四区 | 日本久久精品视频 | 成人毛片一区二区三区 | 欧美h视频 | 99精品一区二区三区 | 中文字幕在线观看一区二区 | a黄毛片 | 亚州国产| 亚洲免费影院 | 日韩福利在线 | 国产高清一区二区三区 | 国产精品av久久久久久毛片 | 99av成人精品国语自产拍 | 国产免费一区二区 | 99精品久久久久 | 中文字幕av免费 | 精品国产乱码久久久久久牛牛 | 久久蜜桃av一区二区天堂 | 日日噜| 婷婷成人在线 | 国产综合精品一区二区三区 | 国产高清免费 | 国产日韩一区二区三区 | 亚州精品天堂中文字幕 | 亚洲一区二区三区在线播放 | 国产一伦一伦一伦 | 国产精品成人品 | 97色在线视频 | 91精品久久久久久久久中文字幕 | 欧美精品久久久久 | 久久精品播放 | 7777在线 | 天天看天天干 | 欧美精品影院 | 午夜亚洲 | 日韩欧美在线视频 | 亚洲精品黄色 |