Skip to content

Commit

Permalink
Remove wave transparency from storage card
Browse files Browse the repository at this point in the history
Change-Id: I6553272fbc6c61ef11981cdc56928162fb89b2d6
  • Loading branch information
DrtSinX98 committed May 9, 2021
1 parent 08e17cb commit 9282913
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,18 @@ protected void init(Context context) {
layout = new RelativeLayout(context);
layout.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.storage_card_min_height)));
waveView = new WaveView(context);
waveView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
waveView.setAlpha(0.5f);
layout.setClickable(true);
TextView storageTitle = new TextView(context);
storageTitle.setTextSize(18);
storageTitle.setTextColor(Utils.getColorAttrDefaultColor(context, android.R.attr.textColorPrimary));
storageTitle.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
storageTitle.setAlpha((float) 0.9);
storageTitle.setAlpha(0.9f);
storageTitle.setPadding(defaultPadding,defaultPadding,0,0);
storageTitle.setText(getResources().getString(R.string.storage_card_title));
layout.addView(waveView);
layout.addView(storageTitle);
waveView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
setupStorageInfo(context);
addView(layout);
setRadius(defaultRadius);
Expand All @@ -88,7 +89,7 @@ private void setupStorageInfo(Context context) {
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
storageInfoUsed.setLayoutParams(params);
storageInfoUsed.setGravity(Gravity.START|Gravity.BOTTOM);
storageInfoUsed.setAlpha((float) 0.9);
storageInfoUsed.setAlpha(0.9f);
storageInfoUsed.setPadding(defaultPadding, 0,0,defaultPadding);
TextView storageInfoTotal = new TextView(context);
storageInfoTotal.setTextSize(16);
Expand All @@ -97,14 +98,14 @@ private void setupStorageInfo(Context context) {
params2.addRule(RelativeLayout.END_OF, R.id.storage_info_used_id);
params2.addRule(RelativeLayout.ALIGN_BASELINE, R.id.storage_info_used_id);
storageInfoTotal.setLayoutParams(params2);
storageInfoTotal.setAlpha((float) 0.9);
storageInfoTotal.setAlpha(0.9f);
TextView storageInfo = new TextView(context);
storageInfo.setTextSize(14);
storageInfo.setTextColor(Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondary));
RelativeLayout.LayoutParams params3 = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params3.addRule(RelativeLayout.ABOVE, R.id.storage_info_used_id);
storageInfo.setLayoutParams(params3);
storageInfo.setAlpha((float) 0.7);
storageInfo.setAlpha(0.7f);
storageInfo.setPadding(defaultPadding, 0,0,0);
storageInfo.setText(getResources().getString(R.string.storage_card_info));
manageStorageInfo(storageInfoUsed, storageInfoTotal);
Expand Down Expand Up @@ -279,8 +280,8 @@ protected class Wave extends View {
private final float WAVE_HZ_FAST = 0.13f;
private final float WAVE_HZ_NORMAL = 0.09f;
private final float WAVE_HZ_SLOW = 0.05f;
public final int DEFAULT_ABOVE_WAVE_ALPHA = 100;
public final int DEFAULT_BLOW_WAVE_ALPHA = 50;
public final int DEFAULT_ABOVE_WAVE_ALPHA = 255;
public final int DEFAULT_BLOW_WAVE_ALPHA = 100;
private final float X_SPACE = 20;
private final double PI2 = 2 * Math.PI;
private Path mAboveWavePath = new Path();
Expand Down Expand Up @@ -487,4 +488,4 @@ protected void onDraw(Canvas canvas) {
canvas.drawRect(getLeft(), 0, getRight(), getBottom(), aboveWavePaint);
}
}
}
}

0 comments on commit 9282913

Please sign in to comment.