Compare commits
8 Commits
3a46ef7f2a
...
1.0.1
Author | SHA1 | Date | |
---|---|---|---|
48e88484cc | |||
49f02cc85d | |||
299e3f721f | |||
a9b0dd43d6 | |||
e2b00eda83 | |||
85cc437b91 | |||
35c2e800b3 | |||
255e2c46d4 |
@@ -7,5 +7,5 @@ No new features planned, only updates are to keep the app available on newer And
|
||||
## Update Notes
|
||||
|
||||
### 2025-07-11
|
||||
(This article)[https://sijus.medium.com/resurrecting-a-5-year-old-android-app-a-developers-journey-59d8f5689e5b]
|
||||
[This article](https://sijus.medium.com/resurrecting-a-5-year-old-android-app-a-developers-journey-59d8f5689e5b)
|
||||
was very helpful in getting this app updated from SDK 25 to 36.
|
||||
|
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "com.hyperling.carbupbeta"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 36
|
||||
versionCode 7
|
||||
versionName "1.0.0"
|
||||
versionCode 8
|
||||
versionName "1.0.1"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@@ -8,6 +8,7 @@
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/dr_face_straight2_circle"
|
||||
android:roundIcon="@drawable/dr_face_straight2_circle"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/CarbUp">
|
||||
<activity
|
||||
@@ -16,7 +17,6 @@
|
||||
android:screenOrientation="fullSensor">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.hyperling.carbupbeta;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
@@ -56,14 +57,27 @@ public class List extends ListInfo{
|
||||
setName(listInfo.getName());
|
||||
|
||||
// ========== Style the buttons ==========
|
||||
// Color!
|
||||
linearLayout.setBackgroundColor(Color.BLACK);
|
||||
btnDelete.setBackgroundColor(Color.LTGRAY);
|
||||
btnDelete.setTextColor(Color.BLACK);
|
||||
btnEdit.setBackgroundColor(Color.LTGRAY);
|
||||
btnEdit.setTextColor(Color.BLACK);
|
||||
btnItem.setBackgroundColor(Color.WHITE);
|
||||
btnItem.setTextColor(getRandomColor());
|
||||
/* Color! */
|
||||
int currentNightMode =
|
||||
context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK
|
||||
;
|
||||
switch (currentNightMode) {
|
||||
// Light Mode
|
||||
case Configuration.UI_MODE_NIGHT_NO:
|
||||
linearLayout.setBackgroundColor(Color.BLACK);
|
||||
btnDelete.setBackgroundColor(Color.LTGRAY);
|
||||
btnDelete.setTextColor(Color.BLACK);
|
||||
btnEdit.setBackgroundColor(Color.LTGRAY);
|
||||
btnEdit.setTextColor(Color.BLACK);
|
||||
btnItem.setBackgroundColor(Color.WHITE);
|
||||
btnItem.setTextColor(getRandomColor());
|
||||
break;// Dark Mode
|
||||
case Configuration.UI_MODE_NIGHT_YES:
|
||||
// Night mode is active, we're using dark theme
|
||||
btnItem.setBackgroundColor(Color.DKGRAY);
|
||||
break;
|
||||
}
|
||||
/* */
|
||||
// Size!
|
||||
//textSize = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/30;
|
||||
btnDelete.setTextSize(16); //textSize-10);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.hyperling.carbupbeta;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Color;
|
||||
import android.widget.LinearLayout;
|
||||
import android.view.WindowManager;
|
||||
@@ -64,13 +65,26 @@ public class ListItem extends ListItemInfo {
|
||||
setName(listItemInfo.getName ());
|
||||
|
||||
// ========== Style the buttons ==========
|
||||
// Color!
|
||||
linearLayout.setBackgroundColor(Color.BLACK);
|
||||
btnDelete.setBackgroundColor(Color.LTGRAY);
|
||||
btnDelete.setTextColor(Color.BLACK);
|
||||
btnEdit.setBackgroundColor(Color.LTGRAY);
|
||||
btnEdit.setTextColor(Color.BLACK);
|
||||
btnItem.setBackgroundColor(Color.WHITE);
|
||||
/* Color! */
|
||||
int currentNightMode =
|
||||
context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK
|
||||
;
|
||||
switch (currentNightMode) {
|
||||
// Light Mode
|
||||
case Configuration.UI_MODE_NIGHT_NO:
|
||||
linearLayout.setBackgroundColor(Color.BLACK);
|
||||
btnDelete.setBackgroundColor(Color.LTGRAY);
|
||||
btnDelete.setTextColor(Color.BLACK);
|
||||
btnEdit.setBackgroundColor(Color.LTGRAY);
|
||||
btnEdit.setTextColor(Color.BLACK);
|
||||
btnItem.setBackgroundColor(Color.WHITE);
|
||||
break;
|
||||
// Dark Mode
|
||||
case Configuration.UI_MODE_NIGHT_YES:
|
||||
btnItem.setBackgroundColor(Color.DKGRAY);
|
||||
break;
|
||||
}
|
||||
/* */
|
||||
int[] colors = getColors(carbPerCal);
|
||||
btnItem.setTextColor(Color.rgb(colors[0], colors[1], colors[2]));
|
||||
// Size!
|
||||
|
@@ -10,6 +10,7 @@ import android.widget.RelativeLayout;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* Created by ling on 1/1/16.
|
||||
@@ -18,7 +19,7 @@ public class MySettingItem extends MySettingInfo{
|
||||
|
||||
private LinearLayout linearLayout;
|
||||
private RelativeLayout relativeLayout;
|
||||
Button btnItem;
|
||||
TextView btnItem;
|
||||
CheckBox checkBox;
|
||||
|
||||
private int textSize;
|
||||
@@ -27,7 +28,7 @@ public class MySettingItem extends MySettingInfo{
|
||||
// Instantiate the Views
|
||||
linearLayout = new LinearLayout(context);
|
||||
relativeLayout = new RelativeLayout(context);
|
||||
btnItem = new Button(context);
|
||||
btnItem = new TextView(context);
|
||||
checkBox = new CheckBox(context);
|
||||
|
||||
// Give the views their required attributes (Wrap Content)
|
||||
@@ -36,7 +37,7 @@ public class MySettingItem extends MySettingInfo{
|
||||
LayoutParams item_lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
|
||||
RelativeLayout.LayoutParams check_lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
|
||||
|
||||
lay_lp.setMargins(1, 1, 1, 1);
|
||||
lay_lp.setMargins(4,4,4,4);
|
||||
linearLayout.setLayoutParams(lay_lp);
|
||||
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
||||
|
||||
@@ -55,15 +56,17 @@ public class MySettingItem extends MySettingInfo{
|
||||
setName(info.getName());
|
||||
setEnabled(info.getEnabled());
|
||||
|
||||
// ========== Style the buttons ==========
|
||||
// Color!
|
||||
/* ========== Style the buttons ========== */
|
||||
/* Color! * /
|
||||
linearLayout.setBackgroundColor(Color.LTGRAY);
|
||||
relativeLayout.setBackgroundColor(Color.LTGRAY);
|
||||
relativeLayout.setBackgroundColor(Color.DKGRAY);
|
||||
btnItem.setBackgroundColor(Color.LTGRAY);
|
||||
btnItem.setTextColor(Color.BLACK);
|
||||
/* */
|
||||
// Size!
|
||||
//textSize = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/30;
|
||||
btnItem.setTextSize(24); // textSize);
|
||||
btnItem.setPadding(4,4,4,4);
|
||||
|
||||
// Add the items to the layout!
|
||||
relativeLayout.addView(checkBox);
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Carb Up! BETA</string>
|
||||
<string name="app_name">Carb Up!</string>
|
||||
<string name="app_name_long">Carb Up! CTFU Helper</string>
|
||||
<string name="app_name_short">Carb Up!</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="title_activity_main">Main</string>
|
||||
<string name="version_name">-= Version Mango =-</string>
|
||||
<string name="version_number">-= v1.0.0 =-</string>
|
||||
<string name="version_number">-= v1.0.1 =-</string>
|
||||
|
||||
<string name="author">Hyperling</string>
|
||||
|
||||
|
@@ -14,15 +14,34 @@
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="CarbUp" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<style name="OriginalTheme"
|
||||
parent="@android:style/Theme.Light.NoTitleBar">
|
||||
</style>
|
||||
|
||||
<style name="CarbUp" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!--
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:colorForeground">@color/colorPrimary</item>
|
||||
-->
|
||||
</style>
|
||||
|
||||
<style name="CarbUpTesting" parent="@android:style/Theme.DeviceDefault">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!--
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:colorForeground">@color/colorPrimary</item>
|
||||
-->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user