Layout changes + programmatically set zoom values for text & icons
|
@ -46,6 +46,7 @@ import android.view.inputmethod.InputMethodManager;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -552,6 +553,66 @@ public class MainActivity extends AppCompatActivity
|
|||
})
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.show();
|
||||
}else if( id == R.id.action_size){
|
||||
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
int textSize = sharedpreferences.getInt(Helper.SET_TEXT_SIZE,100);
|
||||
int iconSize = sharedpreferences.getInt(Helper.SET_ICON_SIZE,100);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
|
||||
builder.setTitle(R.string.text_size);
|
||||
|
||||
View popup_quick_settings = getLayoutInflater().inflate( R.layout.popup_text_size, null );
|
||||
builder.setView(popup_quick_settings);
|
||||
|
||||
SeekBar set_text_size = (SeekBar) popup_quick_settings.findViewById(R.id.set_text_size);
|
||||
SeekBar set_icon_size = (SeekBar) popup_quick_settings.findViewById(R.id.set_icon_size);
|
||||
final TextView set_text_size_value = (TextView) popup_quick_settings.findViewById(R.id.set_text_size_value);
|
||||
final TextView set_icon_size_value = (TextView) popup_quick_settings.findViewById(R.id.set_icon_size_value);
|
||||
set_text_size_value.setText(String.format("%s%%",String.valueOf(textSize)));
|
||||
set_icon_size_value.setText(String.format("%s%%",String.valueOf(iconSize)));
|
||||
|
||||
set_text_size.setMax(12);
|
||||
set_icon_size.setMax(12);
|
||||
|
||||
set_text_size.setProgress(((textSize-70)/5));
|
||||
set_icon_size.setProgress(((textSize-70)/5));
|
||||
|
||||
set_text_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {}
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
|
||||
int value = 70 + progress*5;
|
||||
set_text_size_value.setText(String.format("%s%%",String.valueOf(value)));
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putInt(Helper.SET_TEXT_SIZE, value);
|
||||
editor.apply();
|
||||
}
|
||||
});
|
||||
set_icon_size.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {}
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {}
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
int value = 70 + progress*5;
|
||||
set_icon_size_value.setText(String.format("%s%%",String.valueOf(value)));
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putInt(Helper.SET_ICON_SIZE, value);
|
||||
editor.apply();
|
||||
}
|
||||
});
|
||||
builder.setPositiveButton(R.string.validate, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
})
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.show();
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
|
|
@ -194,6 +194,8 @@ public class Helper {
|
|||
public static final String SET_NSFW_TIMEOUT = "set_nsfw_timeout";
|
||||
public static final String SET_TABS = "set_tabs";
|
||||
public static final String SET_MEDIA_URLS = "set_media_urls";
|
||||
public static final String SET_TEXT_SIZE = "set_text_size";
|
||||
public static final String SET_ICON_SIZE = "set_icon_size";
|
||||
public static final int ATTACHMENT_ALWAYS = 1;
|
||||
public static final int ATTACHMENT_WIFI = 2;
|
||||
public static final int ATTACHMENT_ASK = 3;
|
||||
|
|
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 98 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 111 B |
After Width: | Height: | Size: 116 B |
After Width: | Height: | Size: 163 B |
After Width: | Height: | Size: 168 B |
After Width: | Height: | Size: 215 B |
After Width: | Height: | Size: 242 B |
After Width: | Height: | Size: 268 B |
After Width: | Height: | Size: 500 B |
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/drawer_padding"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/text_size_change"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<LinearLayout
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/set_text_size_value"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_text_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/icon_size_change"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<LinearLayout
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:id="@+id/set_icon_size_value"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<SeekBar
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/set_icon_size"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</SeekBar>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -13,6 +13,10 @@
|
|||
android:id="@+id/action_about_instance"
|
||||
android:title="@string/action_about_instance"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_size"
|
||||
android:title="@string/text_size"
|
||||
app:showAsAction="never" />
|
||||
<item
|
||||
android:id="@+id/action_cache"
|
||||
android:title="@string/action_cache"
|
||||
|
|
|
@ -45,6 +45,9 @@
|
|||
<string name="speech_not_supported">Désolé ! Votre appareil ne supporte pas la commande vocale !</string>
|
||||
<string name="delete_all">Tout effacer</string>
|
||||
<string name="schedule">Programmer</string>
|
||||
<string name="text_size">Taille du texte et des icônes</string>
|
||||
<string name="text_size_change">Modifier la taille du texte :</string>
|
||||
<string name="icon_size_change">Modifier la taille des icônes :</string>
|
||||
<string name="next">Suivant</string>
|
||||
<string name="previous">Précédent</string>
|
||||
<string name="open_with">Ouvrir avec</string>
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
<string name="delete_all">Delete all</string>
|
||||
|
||||
<string name="schedule">Schedule</string>
|
||||
|
||||
<string name="text_size">Text and icon sizes</string>
|
||||
<string name="text_size_change">Change the current text size:</string>
|
||||
<string name="icon_size_change">Change the current icon size:</string>
|
||||
<string name="next">Next</string>
|
||||
<string name="previous">Previous</string>
|
||||
<string name="open_with">Open with</string>
|
||||
|
|