Commit 9624f74e authored by Gilbert Ndresaj's avatar Gilbert Ndresaj

Small Cleen

parent 656c1e7d
......@@ -11,6 +11,7 @@ import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SwitchCompat;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
......@@ -202,6 +203,8 @@ public abstract class ThemedActivity extends AppCompatActivity implements UiElem
themeHelper.themeCheckBox(chk);
}
protected void themeButton(Button btn) {themeHelper.themeButton(btn);}
public void setSwitchColor(SwitchCompat sw, int color){
themeHelper.setSwitchCompactColor(sw, color);
}
......
......@@ -134,7 +134,7 @@ public class AlertDialogsHelper {
@Override
public void onClick(View view) {
showMoreDetails(dialogLayout, activity, f);
showMoreText.setVisibility(View.INVISIBLE);
showMoreText.setVisibility(View.GONE);
}
});
......@@ -161,7 +161,7 @@ public class AlertDialogsHelper {
value.setLayoutParams((new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 7f)));
label.setTextColor(activity.getTextColor());
label.setTypeface(null, Typeface.BOLD);
label.setGravity(Gravity.END);
label.setGravity(Gravity.RIGHT);
label.setTextSize(16);
value.setTextColor(activity.getTextColor());
value.setTextSize(16);
......
......@@ -13,6 +13,7 @@ import android.support.v4.content.ContextCompat;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
......@@ -153,6 +154,14 @@ public class ThemeHelper {
}
}
public int getButtonBackgroundColor(){
switch (baseTheme){
case DARK: return getColor(R.color.md_grey_700);
case AMOLED: return getColor(R.color.md_grey_900);
case LIGHT: default: return getColor(R.color.md_grey_200);
}
}
public IconicsDrawable getToolbarIcon(IIcon icon) {
return new IconicsDrawable(context).icon(icon).color(Color.WHITE).sizeDp(18);
}
......@@ -240,6 +249,11 @@ public class ThemeHelper {
}
}
public void themeButton(Button btn){
btn.setTextColor(getTextColor());
btn.setBackgroundColor(getButtonBackgroundColor());
}
public void setSwitchCompactColor(SwitchCompat sw, int color){
/** SWITCH HEAD **/
sw.getThumbDrawable().setColorFilter(
......
......@@ -149,13 +149,15 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/medium_spacing"
android:padding="@dimen/small_spacing"
android:layout_marginStart="@dimen/medium_spacing"
android:layout_marginEnd="@dimen/big_spacing"
android:layout_marginBottom="@dimen/medium_spacing"
android:layout_gravity="end"
android:id="@+id/button_donate_play_store"
android:elevation="@dimen/fab_elevation"
android:text="@string/donate"
android:clickable="true"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
......@@ -215,12 +217,16 @@
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/medium_spacing"
android:layout_margin="@dimen/big_spacing"
android:layout_gravity="right"
android:padding="@dimen/small_spacing"
android:layout_marginStart="@dimen/medium_spacing"
android:layout_marginEnd="@dimen/big_spacing"
android:layout_marginBottom="@dimen/medium_spacing"
android:layout_gravity="end"
android:id="@+id/button_donate_paypal"
android:elevation="@dimen/fab_elevation"
android:text="@string/donate"
android:textAllCaps="true"
android:clickable="true"
/>
</LinearLayout>
......
......@@ -3,16 +3,17 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="2dp"
android:id="@+id/photo_details_card">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/details_title"
......@@ -33,15 +34,20 @@
/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:clickable="true"
android:background="@drawable/ripple"
>
<LinearLayout
android:layout_width="match_parent"
android:id="@+id/ll_list_details"
android:layout_height="wrap_content"
android:id="@+id/ll_list_details"
android:orientation="vertical"
android:paddingTop="@dimen/small_spacing"
/>
......
......@@ -26,6 +26,7 @@ public class DonateActivity extends ThemedActivity {
private Toolbar toolbar;
private CustomTabService cts;
private ScrollView scr;
private Button btnDonatePP;
@Override
protected void onPostCreate(Bundle savedInstanceState) {
......@@ -72,10 +73,11 @@ public class DonateActivity extends ThemedActivity {
@Override
public void updateUiElements() {
toolbar.setBackgroundColor(getPrimaryColor());
toolbar.setBackgroundColor(getPrimaryColor());
setStatusBarColor();
setNavBarColor();
themeButton(btnDonatePP);
setRecentApp(getString(R.string.donate));
((TextView) findViewById(R.id.team_name)).setTextColor(getAccentColor());
......
......@@ -37,6 +37,8 @@ public class DonateActivity extends ThemedActivity {
private ScrollView scr;
private IabHelper mHelper;
private SeekBar bar; private int progress = 2;
private Button btnDonateIap;
private Button btnDonatePP;
private final IabHelper.OnConsumeFinishedListener mPurchaseFinishedListener =
new IabHelper.OnConsumeFinishedListener() {
......@@ -91,7 +93,6 @@ public class DonateActivity extends ThemedActivity {
private void initUi(){
/**** ToolBar *****/
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(
new IconicsDrawable(this)
......@@ -106,26 +107,26 @@ public class DonateActivity extends ThemedActivity {
});
toolbar.setTitle(getString(org.horaapps.leafpic.R.string.donate));
final Button btnDonateIap = (Button) findViewById(R.id.button_donate_play_store);
/**** DONATE PLAY STORE ****/
btnDonateIap = (Button) findViewById(R.id.button_donate_play_store);
btnDonateIap.setText(String.format("%s %d€", getString(R.string.donate).toUpperCase(), progress));
themeSeekBar(bar);
bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
if (i == 0) progress = 2;
else progress = (i+1)*2;
btnDonateIap.setText(String.format("%s %d€", getString(R.string.donate).toUpperCase(), progress));
}
@Override public void onStartTrackingTouch(SeekBar seekBar) { }
@Override public void onStopTrackingTouch(SeekBar seekBar) { }
});
/**** DONATE PAY PAL ****/
btnDonatePP = (Button) findViewById(R.id.button_donate_paypal);
btnDonatePP.setText(getString(R.string.donate).toUpperCase());
/** ACTIONS **/
((Button) findViewById(R.id.button_donate_paypal)).setText(getString(R.string.donate).toUpperCase());
findViewById(org.horaapps.leafpic.R.id.button_donate_paypal).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -147,9 +148,7 @@ public class DonateActivity extends ThemedActivity {
findViewById(R.id.button_donate_play_store).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (mHelper != null) mHelper.flagEndAsync();
mHelper.launchPurchaseFlow(DonateActivity.this, "donation_" + progress, 123, new IabHelper.OnIabPurchaseFinishedListener() {
@Override
public void onIabPurchaseFinished(IabResult result, Purchase info) {
......@@ -168,6 +167,12 @@ public class DonateActivity extends ThemedActivity {
setNavBarColor();
setRecentApp(getString(org.horaapps.leafpic.R.string.donate));
/**** Buttons & Bar ****/
themeSeekBar(bar);
themeButton(btnDonateIap);
themeButton(btnDonatePP);
/**** Title Cards ***/
((TextView) findViewById(org.horaapps.leafpic.R.id.team_name)).setTextColor(getAccentColor());
((TextView) findViewById(org.horaapps.leafpic.R.id.donate_googleplay_item_title)).setTextColor(getAccentColor());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment