Skip to content

Commit b06df44

Browse files
committed
Implemented and applied a theme that adheres to day/night device theme.
1 parent 9fb54bd commit b06df44

File tree

25 files changed

+161
-106
lines changed

25 files changed

+161
-106
lines changed

Opaque-app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232
android:icon="@mipmap/icon_opaque"
3333
android:label="@string/opaque_app_name"
34-
android:theme="@android:style/Theme.DeviceDefault">
34+
android:theme="@style/AppThemeDayNight"
35+
>
3536
<uses-library
3637
android:name="org.apache.http.legacy"
3738
android:required="false" />
@@ -42,7 +43,8 @@
4243
android:exported="true"
4344
android:label="@string/opaque_app_name"
4445
android:resizeableActivity="true"
45-
android:theme="@android:style/Theme.DeviceDefault">
46+
android:theme="@style/AppThemeDayNight"
47+
>
4648
<intent-filter>
4749
<action android:name="android.intent.action.MAIN" />
4850

@@ -56,14 +58,16 @@
5658
android:label="@string/opaque_app_name"
5759
android:resizeableActivity="true"
5860
android:screenOrientation="fullUser"
59-
android:theme="@android:style/Theme.DeviceDefault" />
61+
android:theme="@style/AppThemeDayNight"
62+
/>
6063
<activity
6164
android:name="com.undatech.opaque.AdvancedSettingsActivity"
6265
android:configChanges="orientation|screenSize|keyboardHidden"
6366
android:label="@string/advanced_settings"
6467
android:resizeableActivity="true"
6568
android:screenOrientation="fullUser"
66-
android:theme="@android:style/Theme.DeviceDefault" />
69+
android:theme="@style/AppThemeDayNight"
70+
/>
6771
<activity
6872
android:name="com.iiordanov.bVNC.RemoteCanvasActivity"
6973
android:configChanges="colorMode|density|fontScale|fontWeightAdjustment|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"

aRDP-app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@
2828
android:banner="@mipmap/banner_ardp"
2929
android:icon="@mipmap/icon_ardp"
3030
android:label="@string/ardp_app_name"
31-
android:theme="@android:style/Theme.DeviceDefault"
31+
android:theme="@style/AppThemeDayNight"
3232
tools:replace="android:label,android:theme">
3333
<activity
3434
android:name="com.undatech.opaque.ConnectionGridActivity"
3535
android:configChanges="keyboardHidden"
3636
android:exported="true"
3737
android:label="@string/ardp_app_name"
3838
android:resizeableActivity="true"
39-
android:theme="@android:style/Theme.DeviceDefault">
39+
android:theme="@style/AppThemeDayNight"
40+
>
4041
<intent-filter>
4142
<action android:name="android.intent.action.MAIN" />
4243

@@ -51,7 +52,7 @@
5152
android:label="@string/ardp_app_name"
5253
android:resizeableActivity="true"
5354
android:screenOrientation="fullUser"
54-
android:theme="@android:style/Theme.DeviceDefault"
55+
android:theme="@style/AppThemeDayNight"
5556
android:windowSoftInputMode="stateHidden|adjustResize" />
5657
<activity
5758
android:name="com.iiordanov.bVNC.RemoteCanvasActivity"

aSPICE-app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@
3333
android:banner="@mipmap/banner_aspice"
3434
android:icon="@mipmap/icon_aspice"
3535
android:label="@string/aspice_app_name"
36-
android:theme="@android:style/Theme.DeviceDefault"
36+
android:theme="@style/AppThemeDayNight"
3737
tools:replace="android:label,android:theme">
3838
<activity
3939
android:name="com.undatech.opaque.ConnectionGridActivity"
4040
android:configChanges="keyboardHidden"
4141
android:exported="true"
4242
android:label="@string/aspice_app_name"
4343
android:resizeableActivity="true"
44-
android:theme="@android:style/Theme.DeviceDefault">
44+
android:theme="@style/AppThemeDayNight"
45+
>
4546
<intent-filter>
4647
<action android:name="android.intent.action.MAIN" />
4748

@@ -56,7 +57,7 @@
5657
android:label="@string/aspice_app_name"
5758
android:resizeableActivity="true"
5859
android:screenOrientation="fullUser"
59-
android:theme="@android:style/Theme.DeviceDefault"
60+
android:theme="@style/AppThemeDayNight"
6061
android:windowSoftInputMode="stateHidden|adjustResize" />
6162
<activity
6263
android:name="com.iiordanov.bVNC.RemoteCanvasActivity"

bVNC-app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626
android:banner="@mipmap/banner_bvnc"
2727
android:icon="@mipmap/icon_bvnc"
2828
android:label="@string/bvnc_app_name"
29-
android:theme="@android:style/Theme.DeviceDefault"
29+
android:theme="@style/AppThemeDayNight"
3030
tools:replace="android:label,android:theme">
3131
<activity
3232
android:name="com.undatech.opaque.ConnectionGridActivity"
3333
android:configChanges="keyboardHidden"
3434
android:exported="true"
3535
android:label="@string/bvnc_app_name"
3636
android:resizeableActivity="true"
37-
android:theme="@android:style/Theme.DeviceDefault">
37+
android:theme="@style/AppThemeDayNight"
38+
>
3839
<intent-filter>
3940
<action android:name="android.intent.action.MAIN" />
4041

@@ -49,7 +50,7 @@
4950
android:label="@string/bvnc_app_name"
5051
android:resizeableActivity="true"
5152
android:screenOrientation="fullUser"
52-
android:theme="@android:style/Theme.DeviceDefault"
53+
android:theme="@style/AppThemeDayNight"
5354
android:windowSoftInputMode="stateHidden|adjustResize" />
5455
<activity
5556
android:name="com.iiordanov.bVNC.RemoteCanvasActivity"

bVNC/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
android:configChanges="keyboardHidden|orientation"
3131
android:resizeableActivity="true"
3232
android:screenOrientation="fullUser"
33-
android:theme="@android:style/Theme.DeviceDefault"
33+
android:theme="@style/AppThemeDayNight"
3434
android:windowSoftInputMode="stateHidden|adjustResize"
3535
/>
3636
<activity
@@ -46,7 +46,7 @@
4646
android:exported="true"
4747
android:resizeableActivity="true"
4848
android:windowSoftInputMode="stateHidden|adjustResize"
49-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
49+
android:theme="@style/AppThemeDayNight"
5050
android:screenOrientation="fullUser">
5151
<intent-filter>
5252
<action android:name="android.intent.action.CREATE_SHORTCUT" />
@@ -78,7 +78,8 @@
7878

7979
<activity
8080
android:name="com.iiordanov.bVNC.GlobalPreferencesActivity"
81-
android:theme="@style/Theme.AppCompat" />
81+
android:theme="@style/AppThemeDayNight"
82+
/>
8283

8384
<meta-data
8485
android:name="com.samsung.android.keepalive.density"

bVNC/src/main/java/com/iiordanov/bVNC/MainConfiguration.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
import android.widget.ToggleButton;
2929

3030
import androidx.annotation.NonNull;
31+
import androidx.appcompat.app.ActionBar;
32+
import androidx.appcompat.app.AppCompatActivity;
33+
import androidx.appcompat.widget.Toolbar;
3134
import androidx.fragment.app.FragmentActivity;
3235

3336
import com.iiordanov.pubkeygenerator.GeneratePubkeyActivity;
@@ -40,7 +43,7 @@
4043
import java.util.Collections;
4144
import java.util.Locale;
4245

43-
public abstract class MainConfiguration extends FragmentActivity {
46+
public abstract class MainConfiguration extends AppCompatActivity {
4447
private final static String TAG = "MainConfiguration";
4548
protected ConnectionBean selected;
4649
protected Database database;
@@ -177,6 +180,7 @@ protected void updateSelectedFromView() {
177180
@Override
178181
public void onCreate(Bundle icicle) {
179182
Log.d(TAG, "onCreate called");
183+
Utils.showActionBarWithTitle(this);
180184
Intent intent = getIntent();
181185
isNewConnection = intent.getBooleanExtra("isNewConnection", false);
182186
initializeConnId(intent.getStringExtra("connID"));

bVNC/src/main/java/com/iiordanov/bVNC/Utils.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
import android.view.inputmethod.InputMethodManager;
5353
import android.widget.ScrollView;
5454

55+
import androidx.appcompat.app.ActionBar;
56+
import androidx.appcompat.app.AppCompatActivity;
57+
5558
import com.antlersoft.android.contentxml.SqliteElement;
5659
import com.antlersoft.android.contentxml.SqliteElement.ReplaceStrategy;
5760
import com.google.android.gms.common.ConnectionResult;
@@ -715,4 +718,12 @@ public static String getFileExtension(Context context) {
715718
}
716719
return extension;
717720
}
721+
722+
public static void showActionBarWithTitle(AppCompatActivity activity) {
723+
ActionBar bar = activity.getSupportActionBar();
724+
if (bar != null) {
725+
bar.setDisplayShowTitleEnabled(true);
726+
}
727+
}
728+
718729
}

bVNC/src/main/java/com/undatech/opaque/ConnectionGridActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import android.widget.TextView;
5757
import android.widget.Toast;
5858

59+
import androidx.appcompat.app.AppCompatActivity;
5960
import androidx.appcompat.widget.AppCompatImageButton;
6061
import androidx.fragment.app.FragmentActivity;
6162
import androidx.fragment.app.FragmentManager;
@@ -83,7 +84,7 @@
8384
import java.io.InputStream;
8485
import java.io.OutputStream;
8586

86-
public class ConnectionGridActivity extends FragmentActivity implements GetTextFragment.OnFragmentDismissedListener {
87+
public class ConnectionGridActivity extends AppCompatActivity implements GetTextFragment.OnFragmentDismissedListener {
8788
private static String TAG = "ConnectionGridActivity";
8889
protected Database database;
8990
protected boolean isStarting = true;
@@ -103,6 +104,7 @@ public class ConnectionGridActivity extends FragmentActivity implements GetTextF
103104
@Override
104105
public void onCreate(Bundle savedInstanceState) {
105106
super.onCreate(savedInstanceState);
107+
Utils.showActionBarWithTitle(this);
106108

107109
appContext = getApplicationContext();
108110
setContentView(R.layout.grid_view_activity);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3+
<solid android:color="#000000" />
4+
<stroke
5+
android:width="6dp"
6+
android:color="#555555" />
7+
<corners android:radius="6dp" />
8+
<padding
9+
android:bottom="2dp"
10+
android:left="2dp"
11+
android:right="2dp"
12+
android:top="2dp" />
13+
</shape>

bVNC/src/main/res/layout/advanced_settings_activity.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
android:layout_width="match_parent"
1818
android:layout_height="wrap_content"
1919
android:layout_gravity="top|center_horizontal"
20-
android:background="@color/black_overlay"
2120
android:orientation="horizontal"
2221
tools:ignore="UselessParent">
2322

0 commit comments

Comments
 (0)