Skip to content

Commit

Permalink
Go to Google Play when apk is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos committed Jun 2, 2015
1 parent 671848e commit be20f3b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 53 deletions.
13 changes: 12 additions & 1 deletion app/src/main/java/com/javiersantos/mlmanager/AppActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import com.javiersantos.mlmanager.utils.AppPreferences;
import com.javiersantos.mlmanager.utils.UtilsApp;
import com.javiersantos.mlmanager.utils.UtilsDialog;
import com.javiersantos.mlmanager.utils.UtilsUI;
import com.melnykov.fab.FloatingActionButton;
import com.mikepenz.iconics.typeface.FontAwesome;

import java.io.File;

Expand Down Expand Up @@ -64,7 +66,7 @@ public void onClick(View view) {
});

if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setStatusBarColor(UtilsApp.darker(appPreferences.getPrimaryColorPref(), 0.8));
getWindow().setStatusBarColor(UtilsUI.darker(appPreferences.getPrimaryColorPref(), 0.8));
toolbar.setBackgroundColor(appPreferences.getPrimaryColorPref());
if (!appPreferences.getNavigationBlackPref()) {
getWindow().setNavigationBarColor(appPreferences.getPrimaryColorPref());
Expand All @@ -77,6 +79,7 @@ private void setScreenElements() {
ImageView icon = (ImageView) findViewById(R.id.app_icon);
TextView name = (TextView) findViewById(R.id.app_name);
TextView apk = (TextView) findViewById(R.id.app_apk);
CardView googleplay = (CardView) findViewById(R.id.id_card);
CardView start = (CardView) findViewById(R.id.start_card);
CardView extract = (CardView) findViewById(R.id.extract_card);
CardView uninstall = (CardView) findViewById(R.id.uninstall_card);
Expand All @@ -91,6 +94,14 @@ private void setScreenElements() {
header.setBackgroundColor(appPreferences.getPrimaryColorPref());

// CardView
googleplay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id=" + appApk));
startActivity(intent);
}
});
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/res/drawable/rounded_border.xml

This file was deleted.

82 changes: 41 additions & 41 deletions app/src/main/res/layout/activity_app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,31 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="180dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/rounded_border"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:id="@+id/relativeLayout2">
<TextView
android:id="@+id/app_apk"
android:layout_width="match_parent"
android:layout_height="18dp"
android:drawableLeft="@drawable/ic_info_outline"
android:drawablePadding="-30sp"
android:text="com.javiersantos"
android:fontFamily="sans-serif-thin"
android:textColor="@color/text_primary"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"/>
<TextView
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_card"
android:layout_width="match_parent"
android:layout_height="1dp"
style="?android:attr/listSeparatorTextViewStyle"
android:background="@color/divider"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="48dp" />
android:layout_height="40dp"
card_view:cardCornerRadius="2dp"
android:foreground="?android:attr/selectableItemBackground"
android:layout_margin="5dp">
<TextView
android:id="@+id/app_apk"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableLeft="@drawable/ic_googleplay"
android:drawablePadding="-30sp"
android:text="com.javiersantos"
android:fontFamily="sans-serif-thin"
android:textColor="@color/text_primary"
android:gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"/>
</android.support.v7.widget.CardView>
</RelativeLayout>

<ScrollView
Expand All @@ -83,24 +83,24 @@
card_view:cardCornerRadius="2dp"
android:foreground="?android:attr/selectableItemBackground"
android:layout_margin="5dp">
<TextView
android:fontFamily="sans-serif-light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:text="@string/dialog_run"
android:textColor="@android:color/black"
android:textSize="25dp" />
<TextView
android:fontFamily="sans-serif-thin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="22dp"
android:layout_marginTop="50dp"
android:text="@string/dialog_run_description"
android:textColor="@android:color/black"
android:textSize="14dp" />
<TextView
android:fontFamily="sans-serif-light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:text="@string/dialog_run"
android:textColor="@android:color/black"
android:textSize="25dp" />
<TextView
android:fontFamily="sans-serif-thin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="22dp"
android:layout_marginTop="50dp"
android:text="@string/dialog_run_description"
android:textColor="@android:color/black"
android:textSize="14dp" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
Expand Down

0 comments on commit be20f3b

Please sign in to comment.