forked from upstream-mirrors/quik
Merge color picker dialog layouts
This commit is contained in:
@@ -499,7 +499,7 @@ public class ThemeManager {
|
|||||||
private static void showColorPicker(QKActivity context, View.OnClickListener saveListener) {
|
private static void showColorPicker(QKActivity context, View.OnClickListener saveListener) {
|
||||||
final QKDialog dialog = new QKDialog();
|
final QKDialog dialog = new QKDialog();
|
||||||
|
|
||||||
View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_color_picker_pager, null, false);
|
View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_color_picker, null, false);
|
||||||
ColorPickerViewHolder holder = new ColorPickerViewHolder(view);
|
ColorPickerViewHolder holder = new ColorPickerViewHolder(view);
|
||||||
|
|
||||||
holder.mTab1.setBackgroundDrawable(getRippleBackground());
|
holder.mTab1.setBackgroundDrawable(getRippleBackground());
|
||||||
@@ -724,7 +724,7 @@ public class ThemeManager {
|
|||||||
@Bind(R.id.tab_1) QKTextView mTab1;
|
@Bind(R.id.tab_1) QKTextView mTab1;
|
||||||
@Bind(R.id.tab_2) QKTextView mTab2;
|
@Bind(R.id.tab_2) QKTextView mTab2;
|
||||||
@Bind(R.id.pager) ViewPager mPager;
|
@Bind(R.id.pager) ViewPager mPager;
|
||||||
@Bind(R.id.palette_view) ColorPickerPalette mPalette;
|
@Bind(R.id.palette) ColorPickerPalette mPalette;
|
||||||
@Bind(R.id.preview) View mPreview;
|
@Bind(R.id.preview) View mPreview;
|
||||||
@Bind(R.id.red) SeekBar mRed;
|
@Bind(R.id.red) SeekBar mRed;
|
||||||
@Bind(R.id.red_value) QKTextView mRedValue;
|
@Bind(R.id.red_value) QKTextView mRedValue;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class ColorPickerDialog extends DialogFragment implements ColorPickerSwat
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Dialog onCreateDialog(Bundle bundle) {
|
public Dialog onCreateDialog(Bundle bundle) {
|
||||||
View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_color_picker, null);
|
View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_color_picker_led, null);
|
||||||
mProgress = ((ProgressBar) view.findViewById(android.R.id.progress));
|
mProgress = ((ProgressBar) view.findViewById(android.R.id.progress));
|
||||||
mPalette = ((ColorPickerPalette) view.findViewById(R.id.color_picker));
|
mPalette = ((ColorPickerPalette) view.findViewById(R.id.color_picker));
|
||||||
mPalette.init(mSize, mColumns, this);
|
mPalette.init(mSize, mColumns, this);
|
||||||
|
|||||||
@@ -1,31 +1,168 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_height="wrap_content"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_gravity="center"
|
android:layout_width="match_parent"
|
||||||
android:gravity="center">
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp"
|
||||||
android:layout_gravity="center_horizontal"
|
android:paddingLeft="16dp"
|
||||||
android:gravity="center"
|
android:paddingRight="16dp">
|
||||||
android:padding="28dp">
|
|
||||||
|
|
||||||
<ProgressBar
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
android:id="@android:id/progress"
|
android:id="@+id/tab_1"
|
||||||
style="?android:attr/progressBarStyleLarge"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:gravity="center"
|
||||||
android:gravity="center" />
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:text="@string/title_palette"
|
||||||
|
app:type="primary_bold" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:id="@+id/tab_2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:text="@string/title_rgb"
|
||||||
|
app:type="primary_bold" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<android.support.v4.view.ViewPager
|
||||||
|
android:id="@+id/pager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="320dp">
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette
|
<com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette
|
||||||
android:id="@+id/color_picker"
|
android:id="@+id/palette"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:gravity="center" />
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="gone" />
|
<LinearLayout
|
||||||
</FrameLayout>
|
android:id="@+id/rgb"
|
||||||
</ScrollView>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/preview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:background="#e2e28e" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lines="1"
|
||||||
|
android:text="R"
|
||||||
|
app:type="secondary"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/red"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="255" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:id="@+id/red_value"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lines="1"
|
||||||
|
app:type="primary"
|
||||||
|
tools:text="41" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lines="1"
|
||||||
|
android:text="G"
|
||||||
|
app:type="secondary"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/green"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="255" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:id="@+id/green_value"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lines="1"
|
||||||
|
app:type="primary"
|
||||||
|
tools:text="22" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lines="1"
|
||||||
|
android:text="B"
|
||||||
|
app:type="secondary"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/blue"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="255" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.QKTextView
|
||||||
|
android:id="@+id/blue_value"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:lines="1"
|
||||||
|
app:type="primary"
|
||||||
|
tools:text="231" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v4.view.ViewPager>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="28dp">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@android:id/progress"
|
||||||
|
style="?android:attr/progressBarStyleLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center" />
|
||||||
|
|
||||||
|
<com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette
|
||||||
|
android:id="@+id/color_picker"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
</ScrollView>
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp">
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:id="@+id/tab_1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:text="@string/title_palette"
|
|
||||||
app:type="primary_bold" />
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:id="@+id/tab_2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:text="@string/title_rgb"
|
|
||||||
app:type="primary_bold" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<android.support.v4.view.ViewPager
|
|
||||||
android:id="@+id/pager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="320dp">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/palette"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.colorpicker.ColorPickerPalette
|
|
||||||
android:id="@+id/palette_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/rgb"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<include layout="@layout/dialog_color_picker_rgb" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</android.support.v4.view.ViewPager>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<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:orientation="vertical">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/preview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="128dp"
|
|
||||||
android:background="#e2e28e" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lines="1"
|
|
||||||
android:text="R"
|
|
||||||
app:type="secondary"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<SeekBar
|
|
||||||
android:id="@+id/red"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:max="255" />
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:id="@+id/red_value"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lines="1"
|
|
||||||
app:type="primary"
|
|
||||||
tools:text="41" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lines="1"
|
|
||||||
android:text="G"
|
|
||||||
app:type="secondary"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<SeekBar
|
|
||||||
android:id="@+id/green"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:max="255" />
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:id="@+id/green_value"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lines="1"
|
|
||||||
app:type="primary"
|
|
||||||
tools:text="22" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:layout_width="24dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lines="1"
|
|
||||||
android:text="B"
|
|
||||||
app:type="secondary"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
|
|
||||||
<SeekBar
|
|
||||||
android:id="@+id/blue"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:max="255" />
|
|
||||||
|
|
||||||
<com.moez.QKSMS.ui.view.QKTextView
|
|
||||||
android:id="@+id/blue_value"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:lines="1"
|
|
||||||
app:type="primary"
|
|
||||||
tools:text="231" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
Reference in New Issue
Block a user