-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
253 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/perol/asdpl/pixivez/manager/ManagerSettingsActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.perol.asdpl.pixivez.manager | ||
|
||
import android.content.res.Configuration | ||
import android.os.Bundle | ||
import androidx.preference.ListPreference | ||
import androidx.preference.PreferenceFragmentCompat | ||
import com.arialyy.aria.core.Aria | ||
import com.perol.asdpl.pixivez.R | ||
import com.perol.asdpl.pixivez.activity.RinkActivity | ||
import kotlinx.android.synthetic.main.settings_activity.* | ||
|
||
class ManagerSettingsActivity : RinkActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.settings_activity) | ||
setSupportActionBar(toolbar) | ||
supportFragmentManager | ||
.beginTransaction() | ||
.replace(R.id.settings, SettingsFragment()) | ||
.commit() | ||
supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
supportActionBar?.setDisplayShowTitleEnabled(false) | ||
toolbar.setNavigationOnClickListener { finish() } | ||
|
||
} | ||
|
||
|
||
class SettingsFragment : PreferenceFragmentCompat() { | ||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { | ||
setPreferencesFromResource(R.xml.root_preferences, rootKey) | ||
findPreference<ListPreference>("max_task_num")!!.setOnPreferenceChangeListener { preference, newValue -> | ||
Aria.get(requireActivity()).downloadConfig.apply { | ||
maxTaskNum = (newValue as String).toInt() | ||
} | ||
true | ||
} | ||
} | ||
|
||
override fun onConfigurationChanged(newConfig: Configuration) { | ||
super.onConfigurationChanged(newConfig) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<data> | ||
|
||
</data> | ||
|
||
<ScrollView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="160dp" /> | ||
|
||
<TextView | ||
android:id="@+id/content" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
</LinearLayout> | ||
</ScrollView> | ||
|
||
</layout> |
Oops, something went wrong.