Skip to content

Commit

Permalink
New setting to hide wind direction information. Release version 1.1.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kestutis-Z committed Jul 20, 2016
1 parent edc75ee commit 048c8e0
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 86 deletions.
2 changes: 1 addition & 1 deletion WorldWeather/WorldWeather.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
57 changes: 39 additions & 18 deletions WorldWeather/app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<afterSyncTasks>
<task>generateDebugAndroidTestSources</task>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
Expand All @@ -28,7 +25,7 @@
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
Expand All @@ -50,50 +47,74 @@
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes-proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debugAndroidTest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/24.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.astuetz/pagerslidingtabstrip/1.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/release" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-24.1.0" level="project" />
<orderEntry type="library" exported="" name="pagerslidingtabstrip-1.0.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.1.0" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-24.1.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.1.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.1.0" level="project" />
<orderEntry type="library" exported="" name="gson-1.7.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.1.0" level="project" />
</component>
</module>
16 changes: 8 additions & 8 deletions WorldWeather/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 24
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.haringeymobile.ukweather"
minSdkVersion 14
targetSdkVersion 23
versionCode 21
versionName "1.1.7"
targetSdkVersion 24
versionCode 22
versionName "1.1.8"

testApplicationId "com.haringeymobile.ukweather.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
Expand All @@ -28,9 +28,9 @@ android {

dependencies {
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v4:24.1.0'
compile 'com.android.support:appcompat-v7:24.1.0'
compile 'com.android.support:recyclerview-v7:24.1.0'
//noinspection GradleDependency
compile 'com.google.code.gson:gson:1.7.1'
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package com.haringeymobile.ukweather;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.content.res.Resources;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;
Expand All @@ -16,6 +11,7 @@
import com.haringeymobile.ukweather.data.objects.Coordinates;
import com.haringeymobile.ukweather.data.objects.SearchResponseForFindQuery;
import com.haringeymobile.ukweather.utils.AsyncTaskWithProgressBar;
import com.haringeymobile.ukweather.utils.GeneralDialogFragment;
import com.haringeymobile.ukweather.utils.MiscMethods;

import java.io.IOException;
Expand Down Expand Up @@ -97,31 +93,10 @@ private void displayErrorMessage() {
* Shows an alert dialog informing that no cities were found for the query.
*/
void showNoCitiesFoundAlertDialog() {
DialogFragment dialogFragment = new DialogFragment() {

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
OnClickListener onClickListener = getDialogOnClickListener();
builder.setTitle(R.string.dialog_title_no_cities_found)
.setMessage(R.string.message_no_cities_found)
.setPositiveButton(android.R.string.ok, onClickListener);
return builder.create();
}

private OnClickListener getDialogOnClickListener() {
return new OnClickListener() {

public void onClick(DialogInterface dialog, int id) {
dismiss();
}

};
}

};

Resources res = activity.getResources();
String dialogTitle = res.getString(R.string.dialog_title_no_cities_found);
String dialogMessage = res.getString(R.string.message_no_cities_found);
DialogFragment dialogFragment = GeneralDialogFragment.newInstance(dialogTitle, dialogMessage);
dialogFragment.show(activity.getSupportFragmentManager(),
NO_CITIES_FOUND_DIALOG_FRAGMENT_TAG);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package com.haringeymobile.ukweather;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.SearchManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
Expand All @@ -30,6 +25,7 @@
import com.haringeymobile.ukweather.database.GeneralDatabaseService;
import com.haringeymobile.ukweather.database.SqlOperation;
import com.haringeymobile.ukweather.settings.SettingsActivity;
import com.haringeymobile.ukweather.utils.GeneralDialogFragment;
import com.haringeymobile.ukweather.utils.MiscMethods;
import com.haringeymobile.ukweather.utils.SharedPrefsHelper;
import com.haringeymobile.ukweather.weather.WeatherForecastParentFragment;
Expand Down Expand Up @@ -222,23 +218,8 @@ private void setCitySearching(Menu menu) {

@Override
public void showAlertDialog(final int stringResourceId) {
new DialogFragment() {

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(stringResourceId)
.setPositiveButton(android.R.string.ok,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dismiss();
}
});
return builder.create();
}

}.show(getSupportFragmentManager(), QUERY_STRING_TOO_SHORT_ALERT_DIALOG_FRAGMENT_TAG);
GeneralDialogFragment.newInstance(getResources().getString(stringResourceId), null).
show(getSupportFragmentManager(), QUERY_STRING_TOO_SHORT_ALERT_DIALOG_FRAGMENT_TAG);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class SettingsActivity extends ThemedActivity
// in res/userpreferences.xml.
public static final String PREF_TEMPERATURE_SCALE = "temperature_scale";
public static final String PREF_WIND_SPEED_MEASUREMENT_UNIT = "wind_speed_measurement_unit";
public static final String PREF_WIND_DIRECTION_DISPLAY = "wind_direction_display";
public static final String PREF_DATA_CACHE_PERIOD = "data_cache_period";
public static final String PREF_APP_THEME = "app_theme";
public static final String PREF_FORECAST_DISPLAY_MODE = "forecast_display_mode";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.haringeymobile.ukweather.utils;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;

/**
* A dialog that displays a title and an (optional) message, and can be dismissed by pressing
* a button.
*/
public class GeneralDialogFragment extends DialogFragment {

public static final String TITLE = "title";
public static final String MESSAGE = "message";

/**
* Creates a new DialogFragment, and sets the provided title and message arguments.
*
* @param title dialog title
* @param message dialog message; may be null, in which case the message is not displayed
* @return a new dialog
*/
public static GeneralDialogFragment newInstance(String title, String message) {
GeneralDialogFragment fragment = new GeneralDialogFragment();
Bundle args = new Bundle();
args.putString(TITLE, title);
args.putString(MESSAGE, message);
fragment.setArguments(args);
return fragment;
}

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Bundle args = getArguments();
String title = args.getString(TITLE);
String message = args.getString(MESSAGE);

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
DialogInterface.OnClickListener onClickListener = getDialogOnClickListener();
builder.setTitle(title);
if (message != null) {
builder.setMessage(message);
}
builder.setPositiveButton(android.R.string.ok, onClickListener);
return builder.create();
}

private DialogInterface.OnClickListener getDialogOnClickListener() {
return new DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int id) {
dismiss();
}

};
}

}
Loading

0 comments on commit 048c8e0

Please sign in to comment.