Skip to content

Commit 73adb04

Browse files
pa1palmariobehling
authored andcommitted
fix: switch compat color (fossasia#906)
1 parent d13d7fa commit 73adb04

File tree

6 files changed

+28
-18
lines changed

6 files changed

+28
-18
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
<activity
321321
android:name=".accounts.AccountActivity"
322322
android:screenOrientation="portrait"
323-
android:theme="@style/Theme.AppCompat.NoActionBar">
323+
android:theme="@style/AppTheme.NoActionBar">
324324
<intent-filter>
325325
<action android:name="android.intent.action.VIEW" />
326326

app/src/main/java/org/fossasia/phimpme/accounts/AccountAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
5151
@Override
5252
public void onBindViewHolder(ViewHolder holder, int position) {
5353
realmResult = realm.where(AccountDatabase.class);
54-
themeHelper.updateSwitchColor(holder.signInSignOutSwitch, switchBackgroundColor);
54+
// themeHelper.updateSwitchColor(holder.signInSignOutSwitch, switchBackgroundColor);
5555
String name = AccountDatabase.AccountName.values()[position].toString();
5656
if (realmResult.equalTo("name", name).count() > 0){
5757
holder.accountName.setText(realmResult

app/src/main/java/org/fossasia/phimpme/share/nextcloud/NextCloudAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private boolean validateHosturl() {
9090
if (email.isEmpty()) {
9191
hostUrlLayout.setError(getString(R.string.err_msg_host));
9292
return false;
93-
} else if (!email.contains("http://")){
93+
} else if (!email.contains("http://") || !email.contains("https://")){
9494
hostUrlLayout.setError("Please add the protocol http/ https");
9595
return false;
9696
} else {

app/src/main/res/layout/accounts_item_view.xml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
4-
xmlns:app="http://schemas.android.com/apk/res-auto"
5-
android:layout_width="match_parent"
6-
android:layout_height="wrap_content"
7-
android:layout_marginBottom="8dp"
8-
android:layout_marginEnd="8dp"
9-
android:layout_marginStart="8dp"
10-
android:layout_marginTop="8dp"
11-
android:orientation="horizontal"
12-
app:srcCompat="@mipmap/ic_launcher">
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
android:layout_width="match_parent"
6+
android:layout_height="wrap_content"
7+
android:layout_marginBottom="8dp"
8+
android:layout_marginEnd="8dp"
9+
android:layout_marginStart="8dp"
10+
android:layout_marginTop="8dp"
11+
android:orientation="horizontal"
12+
app:srcCompat="@mipmap/ic_launcher">
1313

1414
<RelativeLayout
1515
android:layout_width="wrap_content"
@@ -23,7 +23,7 @@
2323
android:layout_marginEnd="8dp"
2424
android:layout_marginStart="8dp"
2525
android:layout_marginTop="8dp"
26-
app:srcCompat="@mipmap/ic_launcher" />
26+
app:srcCompat="@mipmap/ic_launcher"/>
2727

2828
<ImageView
2929
android:id="@+id/account_logo_indicator"
@@ -32,7 +32,7 @@
3232
android:layout_alignBottom="@+id/account_avatar"
3333
android:layout_alignEnd="@+id/account_avatar"
3434
android:layout_alignRight="@+id/account_avatar"
35-
app:srcCompat="@mipmap/ic_launcher" />
35+
app:srcCompat="@mipmap/ic_launcher"/>
3636
</RelativeLayout>
3737

3838
<TextView
@@ -45,7 +45,7 @@
4545
android:layout_weight="5"
4646
android:text="TextView"
4747
android:textColor="@color/black"
48-
android:textSize="20sp" />
48+
android:textSize="20sp"/>
4949

5050
<ImageView
5151
android:id="@+id/sign_out_button"
@@ -57,13 +57,15 @@
5757
app:layout_constraintBottom_toBottomOf="parent"
5858
app:layout_constraintEnd_toEndOf="parent"
5959
app:layout_constraintTop_toTopOf="parent"
60-
app:srcCompat="@drawable/ic_close_black_24dp" />
60+
app:srcCompat="@drawable/ic_close_black_24dp"/>
6161

6262
<android.support.v7.widget.SwitchCompat
6363
android:id="@+id/sign_in_sign_out_switch"
6464
android:layout_width="wrap_content"
6565
android:layout_height="wrap_content"
6666
android:layout_gravity="center"
6767
android:layout_marginLeft="0dp"
68-
android:layout_weight="1" />
68+
android:layout_weight="1"
69+
app:theme="@style/CustomSwitch"/>
70+
6971
</LinearLayout>

app/src/main/res/values/styles.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
55
<!-- Customize your theme here. -->
66
<item name="colorPrimary">@color/colorPrimary</item>
77
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
@@ -221,4 +221,11 @@
221221
<item name="android:windowTitleBackgroundStyle">@drawable/com_facebook_button_background
222222
</item>
223223
</style>
224+
225+
<style name="CustomSwitch" parent="@style/AppTheme.NoActionBar">
226+
<item name="colorControlActivated">@color/green</item>
227+
<item name="colorSwitchThumbNormal">@color/grey</item>
228+
<item name="android:colorForeground">@color/accent_grey</item>
229+
</style>
230+
224231
</resources>

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ org.gradle.jvmargs=-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+Heap
2323
org.gradle.parallel=true
2424
# When set to true the Gradle daemon is used to run the build. For local developer builds this is our favorite property.
2525
# The developer environment is optimized for speed and feedback so we nearly always run Gradle jobs with the daemon.
26+
android.enableBuildCache=false
2627
org.gradle.daemon=true

0 commit comments

Comments
 (0)