Skip to content

Commit

Permalink
Set primary color to app buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos committed Jun 4, 2015
1 parent 3df2434 commit 26df5dd
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@
import com.javiersantos.mlmanager.AppActivity;
import com.javiersantos.mlmanager.AppInfo;
import com.javiersantos.mlmanager.R;
import com.javiersantos.mlmanager.utils.AppPreferences;
import com.javiersantos.mlmanager.utils.UtilsApp;
import com.javiersantos.mlmanager.utils.UtilsDialog;

import java.io.File;
import java.util.List;

public class AppAdapter extends RecyclerView.Adapter<AppAdapter.AppViewHolder> {
// Load Settings
private AppPreferences appPreferences;

// AppAdater variables
private List<AppInfo> appList;
private Context context;

public AppAdapter(List<AppInfo> appList, Context context) {
this.appList = appList;
this.context = context;
this.appPreferences = new AppPreferences(context);
}

@Override
Expand All @@ -54,6 +60,9 @@ private void setButtonEvents(AppViewHolder appViewHolder, final AppInfo appInfo)
ButtonFlat appShare = appViewHolder.vShare;
CardView cardView = appViewHolder.vCard;

appExtract.setBackgroundColor(appPreferences.getPrimaryColorPref());
appShare.setBackgroundColor(appPreferences.getPrimaryColorPref());

appExtract.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down Expand Up @@ -92,6 +101,7 @@ public void onClick(View view) {
intent.putExtra("app_data", appInfo.getData());
Bitmap bitmap = ((BitmapDrawable)appInfo.getIcon()).getBitmap();
intent.putExtra("app_icon", bitmap);
intent.putExtra("app_isSystem", appInfo.isSystem());

context.startActivity(intent);
activity.overridePendingTransition(R.anim.slide_in_right, R.anim.fade_back);
Expand Down

0 comments on commit 26df5dd

Please sign in to comment.