From 5af725529913a856ab0363f6f76c2f55b0a8bf47 Mon Sep 17 00:00:00 2001 From: Adithya J Date: Tue, 7 Mar 2017 22:33:43 +0530 Subject: [PATCH] :sparkles: Fix Social links in About --- app/build.gradle | 4 ++-- .../instincts/activities/AboutActivity.java | 24 ++++++++++++++----- app/src/main/res/drawable/ic_local_pizza.xml | 10 ++++---- app/src/main/res/layout/fragment_buses.xml | 13 ++++++---- app/src/main/res/menu/menu_about.xml | 2 +- app/src/main/res/menu/menu_events.xml | 2 +- 6 files changed, 36 insertions(+), 19 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f851d60..55b8301 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,8 +28,8 @@ android { applicationId "com.pimp.instincts" minSdkVersion 21 targetSdkVersion 25 - versionCode 4 - versionName "1.3.0" + versionCode 5 + versionName "1.3.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java b/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java index a78d5e3..123ef6e 100644 --- a/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java +++ b/app/src/main/java/com/pimp/instincts/activities/AboutActivity.java @@ -18,6 +18,7 @@ package com.pimp.instincts.activities; +import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; import android.os.Bundle; @@ -78,13 +79,24 @@ public boolean onOptionsItemSelected(MenuItem item) { startActivity(browserIntent1); break; case R.id.action_facebook: - Intent browserIntent2 = new Intent(Intent.ACTION_VIEW, - Uri.parse("https://www.facebook.com/instincts.ssn/")); - startActivity(browserIntent2); + Uri uri1 = Uri.parse("https://www.facebook.com/instincts.ssn"); + try { + this.getPackageManager().getPackageInfo("com.facebook.katana", 0); + startActivity(new Intent(Intent.ACTION_VIEW, + Uri.parse("fb://facewebmodal/f?href=" + uri1))); + } catch (Exception e) { + startActivity(new Intent(Intent.ACTION_VIEW, uri1)); + } + break; case R.id.action_instagram: - Intent browserIntent3 = new Intent(Intent.ACTION_VIEW, - Uri.parse("https://www.instagram.com/ssninstincts/")); - startActivity(browserIntent3); + Uri uri2 = Uri.parse("http://instagram.com/_u/ssninstincts"); + try { + Intent intent = new Intent(Intent.ACTION_VIEW, uri2); + intent.setPackage("com.instagram.android"); + startActivity(intent); + } catch (ActivityNotFoundException e) { + startActivity(new Intent(Intent.ACTION_VIEW, uri2)); + } break; } return super.onOptionsItemSelected(item); diff --git a/app/src/main/res/drawable/ic_local_pizza.xml b/app/src/main/res/drawable/ic_local_pizza.xml index d214f27..5356596 100644 --- a/app/src/main/res/drawable/ic_local_pizza.xml +++ b/app/src/main/res/drawable/ic_local_pizza.xml @@ -17,11 +17,11 @@ --> + android:width="24dp" + android:height="24dp" + android:viewportHeight="24.0" + android:viewportWidth="24.0"> + android:pathData="M12,2C8.43,2 5.23,3.54 3.01,6L12,22l8.99,-16C18.78,3.55 15.57,2 12,2zM7,7c0,-1.1 0.9,-2 2,-2s2,0.9 2,2 -0.9,2 -2,2 -2,-0.9 -2,-2zM12,15c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z" /> diff --git a/app/src/main/res/layout/fragment_buses.xml b/app/src/main/res/layout/fragment_buses.xml index 5ff98ee..8ca06ba 100644 --- a/app/src/main/res/layout/fragment_buses.xml +++ b/app/src/main/res/layout/fragment_buses.xml @@ -32,10 +32,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" - android:fontFamily="sans-serif" - android:text="SSN Bus Routes" - android:textSize="20sp" - android:textStyle="bold" /> + android:text="SSN Bus Routes" /> + + diff --git a/app/src/main/res/menu/menu_events.xml b/app/src/main/res/menu/menu_events.xml index 4b9fd2c..ec52626 100644 --- a/app/src/main/res/menu/menu_events.xml +++ b/app/src/main/res/menu/menu_events.xml @@ -30,6 +30,6 @@ android:id="@+id/action_food" android:icon="@drawable/ic_local_pizza" android:orderInCategory="100" - android:title="Search" + android:title="Food Stalls" app:showAsAction="always" />