Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade to SDK 19 and add a degree suffix to weather temperature (also fix up docs). #30

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,10 +23,10 @@ How to Run
----
1. Clone project
2. Get a [forecast.io api key](https://developer.forecast.io/)
3. Add a keys.xml file under res/values with \<string name="dark_sky_api_key">your_key\</string>
3. Add a keys.xml file under res/values with \<resources>\<string name="dark_sky_api_key">your_key\</string>\</resources>
4. Import project to Android Studio and run

When its mirror time, I also recommend turning on the device Developer Option: "Stay Awake - Screen will never sleep while charging"
When it is mirror time, I also recommend turning on the device Developer Option: "Stay Awake - Screen will never sleep while charging"

Making a Mirror
====
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
compileSdkVersion 19
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.morristaedt.mirror"
minSdkVersion 14
targetSdkVersion 22
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
@@ -17,6 +16,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

repositories {
@@ -25,7 +26,7 @@ repositories {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.ahorn:android-rss:cf40b89'
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ public class BirthdayModule {
private static HashMap<String, String> mBirthdayMap;

static {
mBirthdayMap = new HashMap<>();
mBirthdayMap = new HashMap();
mBirthdayMap.put("01/17", "Hannah");
mBirthdayMap.put("05/8", "Andy");
}
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ protected ForecastResponse doInBackground(Void... params) {
protected void onPostExecute(ForecastResponse forecastResponse) {
if (forecastResponse != null) {
if (forecastResponse.currently != null) {
listener.onWeatherToday(forecastResponse.currently.getDisplayTemperature() + " " + forecastResponse.currently.summary);
listener.onWeatherToday(forecastResponse.currently.getDisplayTemperature() + (units.equals(ForecastRequest.UNITS_SI)?"C":"F") +" " + forecastResponse.currently.summary);
}

if (WeekUtil.isWeekday() && !WeekUtil.afterFive() && forecastResponse.hourly != null && forecastResponse.hourly.data != null) {
Original file line number Diff line number Diff line change
@@ -95,7 +95,10 @@ public void receiveDetections(final Detector.Detections<Face> detections) {
.build();

mCameraSource.start();
} catch (IOException | RuntimeException e) {
} catch (IOException e) {
Log.e(TAG, "Something went horribly wrong, with your face.", e);
}
catch ( RuntimeException e) {
Log.e(TAG, "Something went horribly wrong, with your face.", e);
}
}
3 changes: 0 additions & 3 deletions app/src/main/res/layout/activity_configuration.xml
Original file line number Diff line number Diff line change
@@ -139,7 +139,6 @@

<EditText
android:id="@+id/latitude"
style="@style/ConfigurationEditText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/item_margin"
@@ -149,7 +148,6 @@

<EditText
android:id="@+id/longitude"
style="@style/ConfigurationEditText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
@@ -166,7 +164,6 @@

<EditText
android:id="@+id/stock_name"
style="@style/ConfigurationEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/item_margin"
3 changes: 2 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -31,7 +31,8 @@
<item name="android:textSize">@dimen/configuration_description_size</item>
</style>

<style name="ConfigurationEditText" parent="Base.Widget.AppCompat.EditText">
<!-- <style name="ConfigurationEditText" parent="Base.Widget.AppCompat.EditText">
<item name="android:textSize">@dimen/configuration_text_size</item>
</style>
-->
</resources>