Prepares layouts + preferences
This commit is contained in:
parent
529a6d79f0
commit
1c1ab6a4e6
|
@ -70,6 +70,7 @@ public class SettingsFragment extends Fragment {
|
||||||
private static final int ACTIVITY_CHOOSE_FILE = 411;
|
private static final int ACTIVITY_CHOOSE_FILE = 411;
|
||||||
private TextView set_folder;
|
private TextView set_folder;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
int count2 = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -412,6 +413,30 @@ public class SettingsFragment extends Fragment {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final Spinner translation_layout_spinner = (Spinner) rootView.findViewById(R.id.translation_layout_spinner);
|
||||||
|
ArrayAdapter<CharSequence> adapterTrans = ArrayAdapter.createFromResource(getActivity(),
|
||||||
|
R.array.settings_translation, android.R.layout.simple_spinner_item);
|
||||||
|
translation_layout_spinner.setAdapter(adapterTrans);
|
||||||
|
|
||||||
|
int positionSpinnerTrans = (sharedpreferences.getInt(Helper.SET_TRANSLATOR, Helper.TRANS_YANDEX));
|
||||||
|
translation_layout_spinner.setSelection(positionSpinnerTrans);
|
||||||
|
translation_layout_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
if( count2 > 0){
|
||||||
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
|
editor.putInt(Helper.SET_TRANSLATOR, position );
|
||||||
|
editor.apply();
|
||||||
|
}else {
|
||||||
|
count2++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return rootView;
|
return rootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,8 @@ public class Helper {
|
||||||
public static final String SET_PREVIEW_REPLIES = "set_preview_replies";
|
public static final String SET_PREVIEW_REPLIES = "set_preview_replies";
|
||||||
public static final String SET_PREVIEW_REPLIES_PP = "set_preview_replies_pp";
|
public static final String SET_PREVIEW_REPLIES_PP = "set_preview_replies_pp";
|
||||||
public static final String SET_BUBBLE_COUNTER = "set_bubble_counter";
|
public static final String SET_BUBBLE_COUNTER = "set_bubble_counter";
|
||||||
|
public static final String SET_TRANSLATOR = "set_translator";
|
||||||
|
|
||||||
public static final int ATTACHMENT_ALWAYS = 1;
|
public static final int ATTACHMENT_ALWAYS = 1;
|
||||||
public static final int ATTACHMENT_WIFI = 2;
|
public static final int ATTACHMENT_WIFI = 2;
|
||||||
public static final int ATTACHMENT_ASK = 3;
|
public static final int ATTACHMENT_ASK = 3;
|
||||||
|
@ -213,6 +215,10 @@ public class Helper {
|
||||||
public static final int THEME_MENU = 2;
|
public static final int THEME_MENU = 2;
|
||||||
public static final int THEME_MENU_TABS = 3;
|
public static final int THEME_MENU_TABS = 3;
|
||||||
|
|
||||||
|
public static final int TRANS_YANDEX = 0;
|
||||||
|
public static final int TRANS_GOOGLE = 1;
|
||||||
|
public static final int TRANS_NONE = 2;
|
||||||
|
|
||||||
public static final String SET_NOTIF_FOLLOW = "set_notif_follow";
|
public static final String SET_NOTIF_FOLLOW = "set_notif_follow";
|
||||||
public static final String SET_NOTIF_ADD = "set_notif_follow_add";
|
public static final String SET_NOTIF_ADD = "set_notif_follow_add";
|
||||||
public static final String SET_NOTIF_ASK = "set_notif_follow_ask";
|
public static final String SET_NOTIF_ASK = "set_notif_follow_ask";
|
||||||
|
|
|
@ -137,6 +137,27 @@
|
||||||
android:text="@string/embedded_browser"
|
android:text="@string/embedded_browser"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TABS Layout -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/translation_layout_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/about_yandex"/>
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/translation_layout_spinner"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/set_javascript_container"
|
android:id="@+id/set_javascript_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -137,6 +137,28 @@
|
||||||
android:text="@string/embedded_browser"
|
android:text="@string/embedded_browser"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Translation engine -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:id="@+id/translation_layout_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/about_yandex"/>
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/translation_layout_spinner"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/set_javascript_container"
|
android:id="@+id/set_javascript_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -329,6 +329,11 @@
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
|
||||||
|
<string-array name="settings_translation">
|
||||||
|
<item>Yandex</item>
|
||||||
|
<item>Google</item>
|
||||||
|
<item>Nein</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string name="action_block">Blockiere</string>
|
<string name="action_block">Blockiere</string>
|
||||||
<string name="action_unblock">Nicht mehr blockieren</string>
|
<string name="action_unblock">Nicht mehr blockieren</string>
|
||||||
|
|
|
@ -324,6 +324,11 @@
|
||||||
<item>Menu</item>
|
<item>Menu</item>
|
||||||
<item>Onglets et menu</item>
|
<item>Onglets et menu</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string-array name="settings_translation">
|
||||||
|
<item>Yandex</item>
|
||||||
|
<item>Google</item>
|
||||||
|
<item>Non</item>
|
||||||
|
</string-array>
|
||||||
<string name="set_title_news">Actualités</string>
|
<string name="set_title_news">Actualités</string>
|
||||||
<string name="set_notification_news">Notifier lors de nouveaux pouets sur la page d\'accueil</string>
|
<string name="set_notification_news">Notifier lors de nouveaux pouets sur la page d\'accueil</string>
|
||||||
<string name="set_show_error_messages">Afficher les messages d\'erreur</string>
|
<string name="set_show_error_messages">Afficher les messages d\'erreur</string>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name" translatable="false">Mastalab</string>
|
<string name="app_name" translatable="false">Mastalab</string>
|
||||||
|
|
||||||
<string name="navigation_drawer_open">Open the menu</string>
|
<string name="navigation_drawer_open">Open the menu</string>
|
||||||
<string name="navigation_drawer_close">Close the menu</string>
|
<string name="navigation_drawer_close">Close the menu</string>
|
||||||
|
|
||||||
|
@ -331,7 +330,11 @@
|
||||||
<item>Tabs and menu</item>
|
<item>Tabs and menu</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="settings_translation">
|
||||||
|
<item>Yandex</item>
|
||||||
|
<item>Google</item>
|
||||||
|
<item>No</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string name="set_title_news">News</string>
|
<string name="set_title_news">News</string>
|
||||||
<string name="set_notification_news">Notify for new toots on the home timeline</string>
|
<string name="set_notification_news">Notify for new toots on the home timeline</string>
|
||||||
|
|
Loading…
Reference in New Issue