sorten tab titles active
This commit is contained in:
parent
ea78dd5bc1
commit
f418152059
4 changed files with 16 additions and 1 deletions
|
@ -40,6 +40,9 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
||||||
recreate();
|
recreate();
|
||||||
MainApp.bus().post(new EventRefreshGui(true));
|
MainApp.bus().post(new EventRefreshGui(true));
|
||||||
}
|
}
|
||||||
|
if (key.equals("short_tabtitles")) {
|
||||||
|
MainApp.bus().post(new EventRefreshGui(true));
|
||||||
|
}
|
||||||
updatePrefSummary(myPreferenceFragment.getPreference(key));
|
updatePrefSummary(myPreferenceFragment.getPreference(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package info.nightscout.androidaps.tabs;
|
package info.nightscout.androidaps.tabs;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
|
@ -36,7 +38,12 @@ public class TabPageAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CharSequence getPageTitle(int position) {
|
public CharSequence getPageTitle(int position) {
|
||||||
return visibleFragmentList.get(position).getNameShort();
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
if(preferences.getBoolean("short_tabtitles", false)){
|
||||||
|
return visibleFragmentList.get(position).getNameShort();
|
||||||
|
}
|
||||||
|
return visibleFragmentList.get(position).getName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -447,4 +447,5 @@
|
||||||
<string name="objectives_shortname">OBJ</string>
|
<string name="objectives_shortname">OBJ</string>
|
||||||
<string name="wear_shortname">WEAR</string>
|
<string name="wear_shortname">WEAR</string>
|
||||||
<string name="smscommunicator_shortname">SMS</string>
|
<string name="smscommunicator_shortname">SMS</string>
|
||||||
|
<string name="short_tabtitles">Shorten tab titles</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -40,5 +40,9 @@
|
||||||
android:inputType="numberDecimal">
|
android:inputType="numberDecimal">
|
||||||
</EditTextPreference>
|
</EditTextPreference>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
<SwitchPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="short_tabtitles"
|
||||||
|
android:title="@string/short_tabtitles"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
Loading…
Reference in a new issue