This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class SimpleService { | |
public static final String API_URL = "http://api.openweathermap.org/data/2.5/forecast/"; | |
public interface OpenWeatherMap { | |
@GET("daily?mode=json") | |
Call<ApiResponse> getWeather( | |
@Query("q") String city, | |
@Query("units") String units, | |
@Query("cnt") int count, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void loadData() { | |
mWeekForecastAdapter.clear(); | |
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext); | |
String location = sharedPreferences.getString(getString(R.string.pref_location_key), | |
getString(R.string.pref_location_default)); | |
String units = sharedPreferences.getString(getString(R.string.pref_units_key), | |
getString(R.string.pref_units_metric)); | |
Retrofit retrofit = new Retrofit.Builder() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<EditTextPreference | |
android:defaultValue="@string/pref_location_default" | |
android:inputType="text" | |
android:key="@string/pref_location_key" | |
android:singleLine="true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<string name="app_name">Sunshine</string> | |
<string name="action_settings">Settings</string> | |
<string name="action_map">Map Location</string> | |
<string name="pref_location_label">Location</string> | |
<string name="pref_location_key" translatable="false">location</string> | |
<string name="pref_location_default" translatable="false">40377</string> | |
<string name="pref_units_label">Temperature Units</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SettingsActivity extends PreferenceActivity | |
implements Preference.OnPreferenceChangeListener { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
// Add 'general' preferences, defined in the XML file | |
// TODO: Add preferences from XML | |
addPreferencesFromResource(R.xml.pref_general); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string-array name="pref_units_options"> | |
<item>@string/pref_units_label_metric</item> | |
<item>@string/pref_units_label_imperial</item> | |
</string-array> | |
<string-array name="pref_units_values"> | |
<item>@string/pref_units_metric</item> | |
<item>@string/pref_units_imperial</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void onPreferedLocationInMap() { | |
SharedPreferences sharedPreferences = PreferenceManager | |
.getDefaultSharedPreferences(mContext); | |
String location = sharedPreferences.getString(getString(R.string.pref_location_key), | |
getString(R.string.pref_location_default)); | |
Uri geoLocation = Uri.parse("geo:0,0?").buildUpon() | |
.appendQueryParameter("q", location) | |
.build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-optimizationpasses 5 | |
-dontusemixedcaseclassnames | |
-dontskipnonpubliclibraryclasses | |
-dontpreverify | |
-verbose | |
# The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. | |
-optimizations !code/simplification/arithmetic | |
-keep public class * extends android.app.Activity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'com.neenbedankt.android-apt' | |
apply plugin: 'me.tatarka.retrolambda' | |
apply from: '../config/quality.gradle' | |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gaharitechnology.vokon.ui.fragment.main; | |
import android.app.Activity; | |
import android.app.ProgressDialog; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.view.LayoutInflater; |
OlderNewer