bug fix, layout fix
This commit is contained in:
parent
d62eeda68e
commit
5a8d5ab913
|
@ -33,11 +33,6 @@ android {
|
||||||
versionNameSuffix '.DEBUG'
|
versionNameSuffix '.DEBUG'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility 1.8
|
|
||||||
targetCompatibility 1.8
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -77,6 +77,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, O
|
||||||
private Button colorButton1, colorButton2, colorButton3, colorButton4;
|
private Button colorButton1, colorButton2, colorButton3, colorButton4;
|
||||||
private EditText proxyAddr, proxyPort, proxyUser, proxyPass;
|
private EditText proxyAddr, proxyPort, proxyUser, proxyPass;
|
||||||
private CompoundButton enableProxy, enableAuth, hqImage;
|
private CompoundButton enableProxy, enableAuth, hqImage;
|
||||||
|
private SeekBar listSizeSelector;
|
||||||
private Spinner locationSpinner;
|
private Spinner locationSpinner;
|
||||||
private TextView list_size;
|
private TextView list_size;
|
||||||
private View root, colorButton1_edge;
|
private View root, colorButton1_edge;
|
||||||
|
@ -96,7 +97,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, O
|
||||||
CompoundButton toggleImg = findViewById(R.id.toggleImg);
|
CompoundButton toggleImg = findViewById(R.id.toggleImg);
|
||||||
CompoundButton toggleAns = findViewById(R.id.toggleAns);
|
CompoundButton toggleAns = findViewById(R.id.toggleAns);
|
||||||
Spinner fontSpinner = findViewById(R.id.spinner_font);
|
Spinner fontSpinner = findViewById(R.id.spinner_font);
|
||||||
SeekBar listSizeSelector = findViewById(R.id.settings_list_seek);
|
listSizeSelector = findViewById(R.id.settings_list_seek);
|
||||||
enableProxy = findViewById(R.id.settings_enable_proxy);
|
enableProxy = findViewById(R.id.settings_enable_proxy);
|
||||||
enableAuth = findViewById(R.id.settings_enable_auth);
|
enableAuth = findViewById(R.id.settings_enable_auth);
|
||||||
hqImage = findViewById(R.id.settings_image_hq);
|
hqImage = findViewById(R.id.settings_image_hq);
|
||||||
|
@ -129,6 +130,8 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, O
|
||||||
fontSpinner.setSelection(settings.getFont());
|
fontSpinner.setSelection(settings.getFont());
|
||||||
|
|
||||||
AppStyles.setViewFontAndColor(settings, root);
|
AppStyles.setViewFontAndColor(settings, root);
|
||||||
|
AppStyles.setSeekBarColor(settings, listSizeSelector);
|
||||||
|
|
||||||
toggleImg.setChecked(settings.getImageLoad());
|
toggleImg.setChecked(settings.getImageLoad());
|
||||||
toggleAns.setChecked(settings.getAnswerLoad());
|
toggleAns.setChecked(settings.getAnswerLoad());
|
||||||
root.setBackgroundColor(settings.getBackgroundColor());
|
root.setBackgroundColor(settings.getBackgroundColor());
|
||||||
|
@ -308,6 +311,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, O
|
||||||
case FONTCOLOR:
|
case FONTCOLOR:
|
||||||
settings.setFontColor(color);
|
settings.setFontColor(color);
|
||||||
AppStyles.setViewFontAndColor(settings, root);
|
AppStyles.setViewFontAndColor(settings, root);
|
||||||
|
AppStyles.setSeekBarColor(settings, listSizeSelector);
|
||||||
colorButton2.setBackgroundColor(color);
|
colorButton2.setBackgroundColor(color);
|
||||||
colorButton2.setTextColor(color ^ INVERTCOLOR);
|
colorButton2.setTextColor(color ^ INVERTCOLOR);
|
||||||
break;
|
break;
|
||||||
|
@ -320,6 +324,9 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, O
|
||||||
|
|
||||||
case HIGHLIGHT:
|
case HIGHLIGHT:
|
||||||
settings.setHighlightColor(color);
|
settings.setHighlightColor(color);
|
||||||
|
AppStyles.setViewFontAndColor(settings, root);
|
||||||
|
AppStyles.setSeekBarColor(settings, listSizeSelector);
|
||||||
|
colorButton2.setTextColor(settings.getFontColor() ^ INVERTCOLOR);
|
||||||
colorButton4.setBackgroundColor(color);
|
colorButton4.setBackgroundColor(color);
|
||||||
colorButton4.setTextColor(color ^ INVERTCOLOR);
|
colorButton4.setTextColor(color ^ INVERTCOLOR);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
package org.nuclearfog.twidda.backend.utils;
|
package org.nuclearfog.twidda.backend.utils;
|
||||||
|
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.graphics.PorterDuff;
|
|
||||||
import android.graphics.PorterDuffColorFilter;
|
import android.graphics.PorterDuffColorFilter;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.kyleduo.switchbutton.SwitchButton;
|
import com.kyleduo.switchbutton.SwitchButton;
|
||||||
|
|
||||||
import org.nuclearfog.twidda.database.GlobalSettings;
|
import org.nuclearfog.twidda.database.GlobalSettings;
|
||||||
|
|
||||||
|
import static android.graphics.PorterDuff.Mode.SRC_ATOP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to set up all TetView preferences
|
* Class to set up all TetView preferences
|
||||||
*/
|
*/
|
||||||
|
@ -79,8 +81,19 @@ public final class AppStyles {
|
||||||
public static void setIconColor(TextView tv, int color) {
|
public static void setIconColor(TextView tv, int color) {
|
||||||
for (Drawable d : tv.getCompoundDrawables()) {
|
for (Drawable d : tv.getCompoundDrawables()) {
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
d.mutate().setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP));
|
d.mutate().setColorFilter(new PorterDuffColorFilter(color, SRC_ATOP));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set up seek bar color
|
||||||
|
*
|
||||||
|
* @param settings global settings instance
|
||||||
|
* @param seekBar seek bar to color
|
||||||
|
*/
|
||||||
|
public static void setSeekBarColor(GlobalSettings settings, SeekBar seekBar) {
|
||||||
|
seekBar.getProgressDrawable().setColorFilter(new PorterDuffColorFilter(settings.getHighlightColor(), SRC_ATOP));
|
||||||
|
seekBar.getThumb().setColorFilter(new PorterDuffColorFilter(settings.getFontColor(), SRC_ATOP));
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -61,34 +61,30 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/userlist_layout_margin"
|
android:layout_marginTop="@dimen/userlist_layout_margin"
|
||||||
android:gravity="end"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<LinearLayout
|
<com.kyleduo.switchbutton.SwitchButton
|
||||||
|
android:id="@+id/list_edit_public_sw"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1">
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="@dimen/userlist_switch_text_margin"
|
||||||
<com.kyleduo.switchbutton.SwitchButton
|
android:layout_marginLeft="@dimen/userlist_switch_text_margin"
|
||||||
android:id="@+id/list_edit_public_sw"
|
android:layout_weight="2"
|
||||||
android:layout_width="wrap_content"
|
android:singleLine="true"
|
||||||
android:layout_height="wrap_content" />
|
android:text="@string/userlist_public_sel" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/userlist_switch_text_margin"
|
|
||||||
android:layout_marginStart="@dimen/userlist_switch_text_margin"
|
|
||||||
android:text="@string/userlist_public_sel"
|
|
||||||
android:singleLine="true" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/userlist_create_list"
|
android:id="@+id/userlist_create_list"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/userlist_button_height"
|
android:layout_height="@dimen/userlist_button_height"
|
||||||
android:layout_weight="1"
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="3"
|
||||||
android:paddingLeft="@dimen/userlist_button_padding"
|
android:paddingLeft="@dimen/userlist_button_padding"
|
||||||
android:paddingRight="@dimen/userlist_button_padding"
|
android:paddingRight="@dimen/userlist_button_padding"
|
||||||
android:text="@string/userlist_create"
|
android:text="@string/userlist_create"
|
||||||
|
|
|
@ -194,7 +194,7 @@
|
||||||
<!--dimen of dialog_userlist.xml-->
|
<!--dimen of dialog_userlist.xml-->
|
||||||
<dimen name="userlist_descr_height">100dp</dimen>
|
<dimen name="userlist_descr_height">100dp</dimen>
|
||||||
<dimen name="userlist_descr_width">300dp</dimen>
|
<dimen name="userlist_descr_width">300dp</dimen>
|
||||||
<dimen name="userlist_switch_text_margin">5dp</dimen>
|
<dimen name="userlist_switch_text_margin">10dp</dimen>
|
||||||
<dimen name="userlist_button_height">20dp</dimen>
|
<dimen name="userlist_button_height">20dp</dimen>
|
||||||
<dimen name="userlist_layout_margin">10dp</dimen>
|
<dimen name="userlist_layout_margin">10dp</dimen>
|
||||||
<dimen name="userlist_button_padding">5dp</dimen>
|
<dimen name="userlist_button_padding">5dp</dimen>
|
||||||
|
|
Loading…
Reference in New Issue