Skip to content

Commit

Permalink
Merge pull request #61 from forrestguice/prep-release-0.2.2
Browse files Browse the repository at this point in the history
prep release 0.2.2
  • Loading branch information
forrestguice authored Sep 23, 2016
2 parents bbaa9c8 + a5596ff commit 072516d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 37 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android
applicationId "com.forrestguice.suntimeswidget"
minSdkVersion 10
targetSdkVersion 23
versionCode 6
versionName "0.2.1"
versionCode 7
versionName "0.2.2"

buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + getDateAsMillis() + "L)"
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ protected void initViews( Context context )

String[] from = new String[] {"name"};
int[] to = new int[] {android.R.id.text1};
getFixAdapter = new SimpleCursorAdapter(myParent, R.layout.layout_listitem_locations, null, from, to);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
getFixAdapter = new SimpleCursorAdapter(myParent, R.layout.layout_listitem_locations, null, from, to, 0);
else getFixAdapter = new SimpleCursorAdapter(myParent, R.layout.layout_listitem_locations, null, from, to);

getFixAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

spin_locationName = (Spinner)findViewById(R.id.appwidget_location_nameSelect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public void onCreate(Bundle savedInstanceState)
}

@Override
@TargetApi(23)
@TargetApi(Build.VERSION_CODES.M)
public void onAttach(Context context)
{
super.onAttach(context);
Expand All @@ -283,13 +283,15 @@ private void initPref_general()
//ListPreference gpsMaxElapsedPref = (ListPreference)findPreference(key);

String key = WidgetSettings.PREF_PREFIX_KEY + "0" + WidgetSettings.PREF_PREFIX_KEY_GENERAL + WidgetSettings.PREF_KEY_GENERAL_CALCULATOR;
//noinspection deprecation
ListPreference calculatorPref = (ListPreference)findPreference(key);
if (calculatorPref != null)
{
initPref_general(calculatorPref);
loadPref_general(this, calculatorPref);
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private static void initPref_general(PreferenceFragment fragment)
{
String key = WidgetSettings.PREF_PREFIX_KEY + "0" + WidgetSettings.PREF_PREFIX_KEY_GENERAL + WidgetSettings.PREF_KEY_GENERAL_CALCULATOR;
Expand Down Expand Up @@ -360,11 +362,13 @@ private void initPref_locale()
//legacyPrefs.put(key, new LegacyListPref(modePref));

String key = AppSettings.PREF_KEY_LOCALE;
//noinspection deprecation
ListPreference localePref = (ListPreference)findPreference(key);
//legacyPrefs.put(key, new LegacyListPref(localePref));

initPref_locale(this, localePref);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private static void initPref_locale(PreferenceFragment fragment)
{
Preference localePref = (Preference)fragment.findPreference(AppSettings.PREF_KEY_LOCALE);
Expand Down Expand Up @@ -418,7 +422,7 @@ public void onResume()
}

@Override
@TargetApi(23)
@TargetApi(Build.VERSION_CODES.M)
public void onAttach(Context context)
{
super.onAttach(context);
Expand Down Expand Up @@ -637,7 +641,9 @@ private void onResume()
*/
private void initPref_places()
{
//noinspection deprecation
Preference clearPlacesPref = (Preference)findPreference("places_clear");
//noinspection deprecation
Preference exportPlacesPref = (Preference)findPreference("places_export");
placesPrefBase = new PlacesPrefsBase(this, clearPlacesPref, exportPlacesPref);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ public void onCreate(SQLiteDatabase db)
{
switch (DATABASE_VERSION)
{
//noinspection ConstantConditions
case 0:
default:
db.execSQL(TABLE_PLACES_CREATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

import com.forrestguice.suntimeswidget.R;
import com.forrestguice.suntimeswidget.settings.AppSettings;
import com.forrestguice.suntimeswidget.settings.WidgetSettings;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ public void run()
Log.d("GetFixTask", "starting location listener; now requesting updates from GPS_PROVIDER...");
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);

} else if (gpsEnabled && netEnabled) {
} else //noinspection ConstantConditions
if (gpsEnabled && netEnabled) {
// gps + network provider
Log.d("GetFixTask", "starting location listener; now requesting updates from GPS_PROVIDER && NETWORK_PROVIDER...");
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package com.forrestguice.suntimeswidget.themes;

import android.content.Context;
import android.content.res.Resources;
import android.support.v4.content.ContextCompat;

import com.forrestguice.suntimeswidget.R;

Expand All @@ -44,7 +44,6 @@ public class DarkTheme extends SuntimesTheme
public DarkTheme(Context context)
{
super();
Resources resources = context.getResources();

this.themeVersion = THEMEDEF_VERSION;
this.themeName = THEMEDEF_NAME;
Expand All @@ -54,12 +53,12 @@ public DarkTheme(Context context)
this.themePadding = THEMEDEF_PADDING;

this.themeTitleSize = THEMEDEF_TITLESIZE;
this.themeTitleColor = resources.getColor(THEMEDEF_TITLECOLOR_ID);
this.themeTitleColor = ContextCompat.getColor(context, THEMEDEF_TITLECOLOR_ID);

this.themeTextColor = resources.getColor(THEMEDEF_TEXTCOLOR_ID);
this.themeSunriseTextColor = resources.getColor(THEMEDEF_SUNRISECOLOR_ID);
this.themeSunsetTextColor = resources.getColor(THEMEDEF_SUNSETCOLOR_ID);
this.themeTimeSuffixColor = resources.getColor(THEMEDEF_TIMESUFFIXCOLOR_ID);
this.themeTextColor = ContextCompat.getColor(context, THEMEDEF_TEXTCOLOR_ID);
this.themeSunriseTextColor = ContextCompat.getColor(context, THEMEDEF_SUNRISECOLOR_ID);
this.themeSunsetTextColor = ContextCompat.getColor(context, THEMEDEF_SUNSETCOLOR_ID);
this.themeTimeSuffixColor = ContextCompat.getColor(context, THEMEDEF_TIMESUFFIXCOLOR_ID);
}

public ThemeDescriptor themeDescriptor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package com.forrestguice.suntimeswidget.themes;

import android.content.Context;
import android.content.res.Resources;
import android.support.v4.content.ContextCompat;

import com.forrestguice.suntimeswidget.R;

Expand All @@ -44,7 +44,6 @@ public class LightTheme extends SuntimesTheme
public LightTheme(Context context)
{
super();
Resources resources = context.getResources();

this.themeVersion = THEMEDEF_VERSION;
this.themeName = THEMEDEF_NAME;
Expand All @@ -54,12 +53,12 @@ public LightTheme(Context context)
this.themePadding = THEMEDEF_PADDING;

this.themeTitleSize = THEMEDEF_TITLESIZE;
this.themeTitleColor = resources.getColor(THEMEDEF_TITLECOLOR_ID);
this.themeTitleColor = ContextCompat.getColor(context, THEMEDEF_TITLECOLOR_ID);

this.themeTextColor = resources.getColor(THEMEDEF_TEXTCOLOR_ID);
this.themeSunriseTextColor = resources.getColor(THEMEDEF_SUNRISECOLOR_ID);
this.themeSunsetTextColor = resources.getColor(THEMEDEF_SUNSETCOLOR_ID);
this.themeTimeSuffixColor = resources.getColor(THEMEDEF_TIMESUFFIXCOLOR_ID);
this.themeTextColor = ContextCompat.getColor(context, THEMEDEF_TEXTCOLOR_ID);
this.themeSunriseTextColor = ContextCompat.getColor(context, THEMEDEF_SUNRISECOLOR_ID);
this.themeSunsetTextColor = ContextCompat.getColor(context, THEMEDEF_SUNSETCOLOR_ID);
this.themeTimeSuffixColor = ContextCompat.getColor(context, THEMEDEF_TIMESUFFIXCOLOR_ID);
}

public ThemeDescriptor themeDescriptor()
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/res/values-de-rCH - Copy/strings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/values-nl - Copy/strings.xml

This file was deleted.

0 comments on commit 072516d

Please sign in to comment.