fix UI on tablet

This commit is contained in:
Max Lv
2013-09-30 13:10:55 +08:00
parent 9bcf54aaad
commit 8598e5a177
4 changed files with 44 additions and 14 deletions
@@ -73,10 +73,10 @@ class Profile {
var download: Int = 0
@DatabaseField
var chnroute: Boolean = false
var chnroute: Boolean = true
@DatabaseField
var global: Boolean = false
var global: Boolean = true
@DatabaseField
var bypass: Boolean = false
@@ -133,7 +133,7 @@ class ProfileManager(settings: SharedPreferences, dbHelper: DBHelper) {
profile
}
def save(): Profile = {
private def loadFromPreferences: Profile = {
val profile = new Profile()
profile.id = settings.getInt(Key.profileId, -1)
@@ -162,8 +162,18 @@ class ProfileManager(settings: SharedPreferences, dbHelper: DBHelper) {
}
profile.individual = settings.getString(Key.proxied, "")
updateProfile(profile)
profile
}
def save(): Profile = {
val profile = loadFromPreferences
updateProfile(profile)
profile
}
def create(): Profile = {
val profile = loadFromPreferences
createOrUpdateProfile(profile)
profile
}
}