Merge pull request 'Update Target SDK' (#1) from dev into main
Reviewed-on: #1
This commit is contained in:
11
README.md
11
README.md
@@ -1,6 +1,11 @@
|
|||||||
# CarbUp
|
# CarbUp
|
||||||
Calculate cost-effectiveness of foods on a High Carb Low Fat lifestyle.
|
Calculate cost-effectiveness of foods on a High Carb Low Fat lifestyle.
|
||||||
|
|
||||||
# Status
|
## Status
|
||||||
Working on open sourcing my free app that has existed on the Play Store for years.
|
No new features planned, only updates are to keep the app available on newer Android versions.
|
||||||
This was my first app and will likely also be the first to get a Kotlin rewrite since it looks ancient on newer devices! ;D
|
|
||||||
|
## Update Notes
|
||||||
|
|
||||||
|
### 2025-07-11
|
||||||
|
[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.
|
||||||
|
@@ -1,26 +1,34 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
namespace "com.hyperling.carbupbeta"
|
||||||
buildToolsVersion "23.0.2"
|
compileSdkVersion 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.hyperling.carbupbeta"
|
applicationId "com.hyperling.carbupbeta"
|
||||||
minSdkVersion 8
|
minSdkVersion 14
|
||||||
targetSdkVersion 23
|
targetSdkVersion 36
|
||||||
versionCode 6
|
versionCode 7
|
||||||
versionName "0.11"
|
versionName "1.0.0"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
/*
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||||
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
||||||
|
*/
|
||||||
|
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
|
})
|
||||||
|
// https://mvnrepository.com/artifact/com.android.support/appcompat-v7
|
||||||
|
implementation group: 'com.android.support', name: 'appcompat-v7', version: '28.0.0'
|
||||||
}
|
}
|
||||||
|
@@ -8,39 +8,30 @@
|
|||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/dr_face_straight2_circle"
|
android:icon="@drawable/dr_face_straight2_circle"
|
||||||
|
android:roundIcon="@drawable/dr_face_straight2_circle"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/CarbUp">
|
||||||
<activity
|
<activity
|
||||||
android:name=".Splash"
|
android:name=".Splash"
|
||||||
android:label="@string/app_name"
|
android:exported="true"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="fullSensor">
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Main"
|
android:name=".Main"
|
||||||
android:label="@string/app_name"
|
android:screenOrientation="fullSensor"
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:theme="@android:style/Theme.Light.NoTitleBar"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Tab1"
|
android:name=".Tab1"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:theme="@android:style/Theme.Light.NoTitleBar"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Tab2"
|
android:name=".Tab2"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:theme="@android:style/Theme.Light.NoTitleBar"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".MySettings"
|
android:name=".MySettings"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:theme="@android:style/Theme.Light.NoTitleBar"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Home"
|
android:name=".Home"
|
||||||
|
@@ -7,14 +7,12 @@ import android.os.Bundle;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.gms.ads.AdRequest;
|
|
||||||
import com.google.android.gms.ads.AdView;
|
|
||||||
|
|
||||||
public class Home extends AppCompatActivity {
|
public class Home extends AppCompatActivity {
|
||||||
|
|
||||||
Resources recs;
|
Resources recs;
|
||||||
@@ -56,23 +54,6 @@ public class Home extends AppCompatActivity {
|
|||||||
|
|
||||||
btnWhyVegan = (Button) findViewById(R.id.btnWhyVegan);
|
btnWhyVegan = (Button) findViewById(R.id.btnWhyVegan);
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Finally, load ads >:)
|
|
||||||
if (Build.VERSION.SDK_INT >= 9) {
|
|
||||||
// Load an ad into the AdMob banner view.
|
|
||||||
AdView adView = (AdView) findViewById(R.id.adViewHome);
|
|
||||||
AdRequest adRequest = new AdRequest.Builder()
|
|
||||||
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
|
|
||||||
.addTestDevice("C6A494DC6E7C9AC29102694D48487084") // nexus 7
|
|
||||||
.addTestDevice("B8B7561B850A9AB24E0D5B560FC50628") // Moto G
|
|
||||||
.addTestDevice("") // Cappy, even though it doesn't support ads
|
|
||||||
.setRequestAgent("android_studio:ad_template")
|
|
||||||
.build();
|
|
||||||
adView.loadAd(adRequest);
|
|
||||||
}
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.hyperling.carbupbeta;
|
package com.hyperling.carbupbeta;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
import android.widget.LinearLayout.LayoutParams;
|
||||||
@@ -56,14 +57,27 @@ public class List extends ListInfo{
|
|||||||
setName(listInfo.getName());
|
setName(listInfo.getName());
|
||||||
|
|
||||||
// ========== Style the buttons ==========
|
// ========== Style the buttons ==========
|
||||||
// Color!
|
/* Color! */
|
||||||
linearLayout.setBackgroundColor(Color.BLACK);
|
int currentNightMode =
|
||||||
btnDelete.setBackgroundColor(Color.LTGRAY);
|
context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK
|
||||||
btnDelete.setTextColor(Color.BLACK);
|
;
|
||||||
btnEdit.setBackgroundColor(Color.LTGRAY);
|
switch (currentNightMode) {
|
||||||
btnEdit.setTextColor(Color.BLACK);
|
// Light Mode
|
||||||
btnItem.setBackgroundColor(Color.WHITE);
|
case Configuration.UI_MODE_NIGHT_NO:
|
||||||
btnItem.setTextColor(getRandomColor());
|
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!
|
// Size!
|
||||||
//textSize = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/30;
|
//textSize = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/30;
|
||||||
btnDelete.setTextSize(16); //textSize-10);
|
btnDelete.setTextSize(16); //textSize-10);
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.hyperling.carbupbeta;
|
package com.hyperling.carbupbeta;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
@@ -64,13 +65,26 @@ public class ListItem extends ListItemInfo {
|
|||||||
setName(listItemInfo.getName ());
|
setName(listItemInfo.getName ());
|
||||||
|
|
||||||
// ========== Style the buttons ==========
|
// ========== Style the buttons ==========
|
||||||
// Color!
|
/* Color! */
|
||||||
linearLayout.setBackgroundColor(Color.BLACK);
|
int currentNightMode =
|
||||||
btnDelete.setBackgroundColor(Color.LTGRAY);
|
context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK
|
||||||
btnDelete.setTextColor(Color.BLACK);
|
;
|
||||||
btnEdit.setBackgroundColor(Color.LTGRAY);
|
switch (currentNightMode) {
|
||||||
btnEdit.setTextColor(Color.BLACK);
|
// Light Mode
|
||||||
btnItem.setBackgroundColor(Color.WHITE);
|
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);
|
int[] colors = getColors(carbPerCal);
|
||||||
btnItem.setTextColor(Color.rgb(colors[0], colors[1], colors[2]));
|
btnItem.setTextColor(Color.rgb(colors[0], colors[1], colors[2]));
|
||||||
// Size!
|
// Size!
|
||||||
|
@@ -10,6 +10,7 @@ import android.widget.RelativeLayout;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ling on 1/1/16.
|
* Created by ling on 1/1/16.
|
||||||
@@ -18,7 +19,7 @@ public class MySettingItem extends MySettingInfo{
|
|||||||
|
|
||||||
private LinearLayout linearLayout;
|
private LinearLayout linearLayout;
|
||||||
private RelativeLayout relativeLayout;
|
private RelativeLayout relativeLayout;
|
||||||
Button btnItem;
|
TextView btnItem;
|
||||||
CheckBox checkBox;
|
CheckBox checkBox;
|
||||||
|
|
||||||
private int textSize;
|
private int textSize;
|
||||||
@@ -27,7 +28,7 @@ public class MySettingItem extends MySettingInfo{
|
|||||||
// Instantiate the Views
|
// Instantiate the Views
|
||||||
linearLayout = new LinearLayout(context);
|
linearLayout = new LinearLayout(context);
|
||||||
relativeLayout = new RelativeLayout(context);
|
relativeLayout = new RelativeLayout(context);
|
||||||
btnItem = new Button(context);
|
btnItem = new TextView(context);
|
||||||
checkBox = new CheckBox(context);
|
checkBox = new CheckBox(context);
|
||||||
|
|
||||||
// Give the views their required attributes (Wrap Content)
|
// 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);
|
LayoutParams item_lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
|
||||||
RelativeLayout.LayoutParams check_lp = new RelativeLayout.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.setLayoutParams(lay_lp);
|
||||||
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
|
||||||
|
|
||||||
@@ -55,15 +56,17 @@ public class MySettingItem extends MySettingInfo{
|
|||||||
setName(info.getName());
|
setName(info.getName());
|
||||||
setEnabled(info.getEnabled());
|
setEnabled(info.getEnabled());
|
||||||
|
|
||||||
// ========== Style the buttons ==========
|
/* ========== Style the buttons ========== */
|
||||||
// Color!
|
/* Color! * /
|
||||||
linearLayout.setBackgroundColor(Color.LTGRAY);
|
linearLayout.setBackgroundColor(Color.LTGRAY);
|
||||||
relativeLayout.setBackgroundColor(Color.LTGRAY);
|
relativeLayout.setBackgroundColor(Color.DKGRAY);
|
||||||
btnItem.setBackgroundColor(Color.LTGRAY);
|
btnItem.setBackgroundColor(Color.LTGRAY);
|
||||||
btnItem.setTextColor(Color.BLACK);
|
btnItem.setTextColor(Color.BLACK);
|
||||||
|
/* */
|
||||||
// Size!
|
// Size!
|
||||||
//textSize = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/30;
|
//textSize = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth()/30;
|
||||||
btnItem.setTextSize(24); // textSize);
|
btnItem.setTextSize(24); // textSize);
|
||||||
|
btnItem.setPadding(4,4,4,4);
|
||||||
|
|
||||||
// Add the items to the layout!
|
// Add the items to the layout!
|
||||||
relativeLayout.addView(checkBox);
|
relativeLayout.addView(checkBox);
|
||||||
|
@@ -17,7 +17,7 @@ public class MySettings extends Activity {
|
|||||||
Context context;
|
Context context;
|
||||||
|
|
||||||
LinearLayout settingsArea;
|
LinearLayout settingsArea;
|
||||||
MySettingItem quickLoad, adsEnabled, rainbowLists, whiteOnBlack;
|
MySettingItem quickLoad, rainbowLists, whiteOnBlack;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -35,16 +35,13 @@ public class MySettings extends Activity {
|
|||||||
|
|
||||||
// Instantiate settings
|
// Instantiate settings
|
||||||
quickLoad = new MySettingItem(context, new MySettingInfo());
|
quickLoad = new MySettingItem(context, new MySettingInfo());
|
||||||
adsEnabled = new MySettingItem(context, new MySettingInfo());
|
|
||||||
|
|
||||||
// Name them
|
// Name them
|
||||||
quickLoad.setName("Quick Load:");
|
quickLoad.setName("Quick Load:");
|
||||||
adsEnabled.setName("Ads Enabled:");
|
|
||||||
|
|
||||||
// Set the checkboxes
|
// Set the checkboxes
|
||||||
dalih.open();
|
dalih.open();
|
||||||
quickLoad.setEnabled(dalih.getQuickLoad());
|
quickLoad.setEnabled(dalih.getQuickLoad());
|
||||||
adsEnabled.setEnabled(dalih.getAdsEnabled());
|
|
||||||
dalih.close();
|
dalih.close();
|
||||||
|
|
||||||
// Set the checkbox actions
|
// Set the checkbox actions
|
||||||
@@ -62,26 +59,8 @@ public class MySettings extends Activity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
adsEnabled.btnItem.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
dalih.setAdsEnabled(!dalih.getAdsEnabled());
|
|
||||||
adsEnabled.checkBox.setChecked(dalih.getAdsEnabled());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
adsEnabled.checkBox.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
dalih.setAdsEnabled(adsEnabled.checkBox.isChecked());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Throw them onto the screen
|
// Throw them onto the screen
|
||||||
settingsArea.addView(quickLoad.getView());
|
settingsArea.addView(quickLoad.getView());
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 9) {
|
|
||||||
settingsArea.addView(adsEnabled.getView());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -15,9 +15,6 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import com.google.android.gms.ads.AdRequest;
|
|
||||||
import com.google.android.gms.ads.AdView;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by usb on 9/28/14.
|
* Created by usb on 9/28/14.
|
||||||
*
|
*
|
||||||
@@ -35,7 +32,6 @@ public class Tab1 extends Activity{
|
|||||||
Button btnCreate;
|
Button btnCreate;
|
||||||
LinearLayout layListArea;
|
LinearLayout layListArea;
|
||||||
TextView tvLeft, tvRight, selectHeader;
|
TextView tvLeft, tvRight, selectHeader;
|
||||||
AdView mAdView;
|
|
||||||
|
|
||||||
// The lists!
|
// The lists!
|
||||||
ArrayList<List> lists = new ArrayList<List>();
|
ArrayList<List> lists = new ArrayList<List>();
|
||||||
@@ -58,7 +54,6 @@ public class Tab1 extends Activity{
|
|||||||
tvLeft = (TextView) findViewById(R.id.leftEditView);
|
tvLeft = (TextView) findViewById(R.id.leftEditView);
|
||||||
tvRight = (TextView) findViewById(R.id.rightEditView);
|
tvRight = (TextView) findViewById(R.id.rightEditView);
|
||||||
selectHeader = (TextView) findViewById(R.id.selectListHeader);
|
selectHeader = (TextView) findViewById(R.id.selectListHeader);
|
||||||
mAdView = (AdView) findViewById(R.id.adView);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -266,26 +261,6 @@ public class Tab1 extends Activity{
|
|||||||
|
|
||||||
dalih.open();
|
dalih.open();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 9) {
|
|
||||||
if (dalih.getAdsEnabled()) {
|
|
||||||
if (mAdView.getVisibility() != View.VISIBLE) {
|
|
||||||
AdRequest adRequest = new AdRequest.Builder()
|
|
||||||
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
|
|
||||||
.addTestDevice("C6A494DC6E7C9AC29102694D48487084") // nexus 7
|
|
||||||
.addTestDevice("B8B7561B850A9AB24E0D5B560FC50628") // Moto G
|
|
||||||
.addTestDevice("") // Cappy, even though it can't get ads
|
|
||||||
.build();
|
|
||||||
mAdView.setVisibility(View.VISIBLE);
|
|
||||||
mAdView.loadAd(adRequest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (mAdView.getVisibility() == View.VISIBLE) {
|
|
||||||
mAdView.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setButtonInsert();
|
setButtonInsert();
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
@@ -11,9 +11,6 @@ import android.widget.EditText;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.gms.ads.AdRequest;
|
|
||||||
import com.google.android.gms.ads.AdView;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,7 +32,6 @@ public class Tab2 extends Activity{
|
|||||||
LinearLayout layListArea;
|
LinearLayout layListArea;
|
||||||
EditText txtName, txtCost, txtServings, txtCalories, txtCarbs, txtFiber;
|
EditText txtName, txtCost, txtServings, txtCalories, txtCarbs, txtFiber;
|
||||||
Button btnClear, btnAdd;
|
Button btnClear, btnAdd;
|
||||||
AdView mAdView;
|
|
||||||
|
|
||||||
// List
|
// List
|
||||||
ArrayList<ListItem> items = new ArrayList<ListItem>();
|
ArrayList<ListItem> items = new ArrayList<ListItem>();
|
||||||
@@ -61,7 +57,6 @@ public class Tab2 extends Activity{
|
|||||||
txtFiber = (EditText) findViewById(R.id.etItemFiber);
|
txtFiber = (EditText) findViewById(R.id.etItemFiber);
|
||||||
btnClear = (Button) findViewById(R.id.btnClear);
|
btnClear = (Button) findViewById(R.id.btnClear);
|
||||||
btnAdd = (Button) findViewById(R.id.btnAddToList);
|
btnAdd = (Button) findViewById(R.id.btnAddToList);
|
||||||
mAdView = (AdView) findViewById(R.id.adView);
|
|
||||||
|
|
||||||
// Give the Buttons their power
|
// Give the Buttons their power
|
||||||
btnClear.setOnClickListener(new View.OnClickListener() {
|
btnClear.setOnClickListener(new View.OnClickListener() {
|
||||||
@@ -91,26 +86,6 @@ public class Tab2 extends Activity{
|
|||||||
|
|
||||||
dalih.open();
|
dalih.open();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 9) {
|
|
||||||
if (dalih.getAdsEnabled()) {
|
|
||||||
if (mAdView.getVisibility() != View.VISIBLE) {
|
|
||||||
AdRequest adRequest = new AdRequest.Builder()
|
|
||||||
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
|
|
||||||
.addTestDevice("C6A494DC6E7C9AC29102694D48487084") // nexus 7
|
|
||||||
.addTestDevice("B8B7561B850A9AB24E0D5B560FC50628") // Moto G
|
|
||||||
.addTestDevice("") // Cappy, even though it can't get ads
|
|
||||||
.build();
|
|
||||||
mAdView.setVisibility(View.VISIBLE);
|
|
||||||
mAdView.loadAd(adRequest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (mAdView.getVisibility() == View.VISIBLE) {
|
|
||||||
mAdView.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setButtonInsert();
|
setButtonInsert();
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
@@ -50,7 +50,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_weight=".45"
|
android:layout_weight=".45"
|
||||||
android:weightSum="1">
|
android:weightSum="1"
|
||||||
|
style="?android:attr/buttonBarStyle">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -64,7 +65,8 @@
|
|||||||
android:text="Why High Carb?"
|
android:text="Why High Carb?"
|
||||||
android:textColor="@color/textPrimaryInverse"
|
android:textColor="@color/textPrimaryInverse"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:id="@+id/btnWhyHCLF"/>
|
android:id="@+id/btnWhyHCLF"
|
||||||
|
style="?android:attr/buttonBarButtonStyle" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -78,17 +80,9 @@
|
|||||||
android:text="Why Vegan?"
|
android:text="Why Vegan?"
|
||||||
android:textColor="@color/textAccentInverse"
|
android:textColor="@color/textAccentInverse"
|
||||||
android:textAllCaps="false"
|
android:textAllCaps="false"
|
||||||
android:id="@+id/btnWhyVegan"/>
|
android:id="@+id/btnWhyVegan"
|
||||||
|
style="?android:attr/buttonBarButtonStyle" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.gms.ads.AdView
|
|
||||||
android:id="@+id/adViewHome"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight=".1"
|
|
||||||
ads:adSize="BANNER"
|
|
||||||
ads:adUnitId="@string/banner_ad_home">
|
|
||||||
</com.google.android.gms.ads.AdView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="?android:actionBarSize"
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="?android:actionBarSize">
|
||||||
|
|
||||||
<TabHost
|
<TabHost
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@+id/title"
|
android:layout_alignParentTop="true"
|
||||||
android:id="@android:id/tabhost">
|
android:id="@android:id/tabhost">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@@ -68,22 +68,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.gms.ads.AdView
|
|
||||||
android:id="@+id/adView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
ads:adSize="BANNER"
|
|
||||||
android:visibility="gone"
|
|
||||||
ads:adUnitId="@string/banner_ad_tab1">
|
|
||||||
</com.google.android.gms.ads.AdView>
|
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true">
|
||||||
android:layout_above="@+id/adView">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -97,22 +97,10 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<com.google.android.gms.ads.AdView
|
|
||||||
android:id="@+id/adView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
ads:adSize="BANNER"
|
|
||||||
android:visibility="gone"
|
|
||||||
ads:adUnitId="@string/banner_ad_tab2">
|
|
||||||
</com.google.android.gms.ads.AdView>
|
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true">
|
||||||
android:layout_above="@+id/adView">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -6,11 +6,13 @@
|
|||||||
<string name="app_name_short">Carb Up!</string>
|
<string name="app_name_short">Carb Up!</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
<string name="title_activity_main">Main</string>
|
<string name="title_activity_main">Main</string>
|
||||||
<string name="version_name">-=Version Banana=-</string>
|
<string name="version_name">-= Version Mango =-</string>
|
||||||
<string name="version_number">-=Beta v0.10=-</string>
|
<string name="version_number">-= v1.0.0 =-</string>
|
||||||
|
|
||||||
<string name="author">Hyperling</string>
|
<string name="author">Hyperling</string>
|
||||||
|
|
||||||
|
<string name="title_activity_home">Home</string>
|
||||||
|
|
||||||
<!-- Tab1 Views -->
|
<!-- Tab1 Views -->
|
||||||
|
|
||||||
<string name="list_header">Create a New List:</string>
|
<string name="list_header">Create a New List:</string>
|
||||||
@@ -52,14 +54,4 @@
|
|||||||
<string name="delete_dialog_ok">Delete</string>
|
<string name="delete_dialog_ok">Delete</string>
|
||||||
<string name="delete_dialog_cancel">Cancel</string>
|
<string name="delete_dialog_cancel">Cancel</string>
|
||||||
|
|
||||||
<!-- Ads -->
|
|
||||||
|
|
||||||
<string name="banner_ad_unit_id">ca-app-pub-9712416021907617/1895014881</string>
|
|
||||||
<string name="banner_ad_tab1">ca-app-pub-9712416021907617/1895014881</string>
|
|
||||||
<string name="banner_ad_tab2">ca-app-pub-9712416021907617/6325214486</string>
|
|
||||||
<string name="banner_ad_home">ca-app-pub-9712416021907617/4055112081</string>
|
|
||||||
<string name="interstitial_ad_splash">ca-app-pub-9712416021907617/9278680882</string>
|
|
||||||
<string name="title_activity_home">Home</string>
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -14,4 +14,34 @@
|
|||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<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>
|
</resources>
|
||||||
|
19
build.gradle
19
build.gradle
@@ -2,10 +2,18 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
url 'https://jitpack.io'
|
||||||
|
}
|
||||||
|
google()
|
||||||
|
maven {
|
||||||
|
url 'https://maven.google.com/'
|
||||||
|
name 'Google'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.5.0'
|
classpath 'com.android.tools.build:gradle:8.11.1'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
@@ -14,6 +22,11 @@ buildscript {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
mavenCentral()
|
||||||
|
google()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task clean(type: Delete) {
|
||||||
|
delete rootProject.buildDir
|
||||||
|
}
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
#Wed Apr 10 15:27:10 PDT 2013
|
#Fri Jul 11 14:14:34 MST 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
|
|
||||||
|
Reference in New Issue
Block a user