Fix TimePicker style

This commit is contained in:
Weiyi Wang 2019-07-28 19:48:36 -04:00 committed by bunnei
parent c92f80ee69
commit 92676e7724
2 changed files with 8 additions and 10 deletions

View File

@ -4,13 +4,13 @@ import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v17.leanback.widget.picker.TimePicker;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.DatePicker; import android.widget.DatePicker;
import android.widget.TimePicker;
import android.widget.SeekBar; import android.widget.SeekBar;
import android.widget.TextView; import android.widget.TextView;
@ -174,9 +174,9 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
String settingValue = item.getValue(); String settingValue = item.getValue();
dp.updateDate(Integer.parseInt(settingValue.substring(0, 4)), Integer.parseInt(settingValue.substring(5, 7)) - 1, Integer.parseInt(settingValue.substring(8, 10))); dp.updateDate(Integer.parseInt(settingValue.substring(0, 4)), Integer.parseInt(settingValue.substring(5, 7)) - 1, Integer.parseInt(settingValue.substring(8, 10)));
tp.setIs24Hour(true); tp.setIs24HourView(true);
tp.setHour(Integer.parseInt(settingValue.substring(11, 12))); tp.setCurrentHour(Integer.parseInt(settingValue.substring(11, 12)));
tp.setMinute(Integer.parseInt(settingValue.substring(14, 15))); tp.setCurrentMinute(Integer.parseInt(settingValue.substring(14, 15)));
DialogInterface.OnClickListener ok = new DialogInterface.OnClickListener() { DialogInterface.OnClickListener ok = new DialogInterface.OnClickListener() {
@Override @Override

View File

@ -15,11 +15,9 @@
android:datePickerMode="spinner" android:datePickerMode="spinner"
android:spinnersShown="true"/> android:spinnersShown="true"/>
<android.support.v17.leanback.widget.picker.TimePicker <TimePicker
android:id="@+id/time_picker" android:id="@+id/time_picker"
android:layout_width="108dp" android:layout_width="match_parent"
android:layout_height="108dp" android:layout_height="wrap_content"
android:scaleX="2.00" android:timePickerMode="spinner"/>
android:scaleY="2.00"
android:scrollX="-20dp" />
</LinearLayout> </LinearLayout>