- エーオーシステム コーポレートサイト
https://www.aosystem.co.jp/ - エーオーシステム プロダクトサイト
https://ao-system.net/ - レンタルサーバー
- バーチャル展示会
- 3Dグラフィック
- Android アプリ
- iOS (iPhone,iPad) アプリ
- Flutter開発
- プログラミング記録QuickAnswer
- 無料画像素材
- スカイボックス 3D SKY BOX
このページのQRコード
下記アプリの主要なソースコードを公開しています。アプリ開発の参考になれば幸いです。
画像等が別途必要ですので下記情報のみでアプリが完成するものではありません。 アプリは少しずつ機能拡張していますのでストア公開されているアプリと内容が異なる場合があります。 コードはコピーして自由にお使いいただけます。ただし著作権は放棄しておりませんので全部の再掲載はご遠慮ください。部分的に再掲載したり、改変して再掲載するのは構いません。 自身のアプリ作成の参考として個人使用・商用問わず自由にお使いいただけます。 コード記述のお手本を示すものではありません。ミニアプリですので変数名などさほど気遣いしていない部分も有りますし間違いも有るかと思いますので参考程度にお考え下さい。 他の賢者の皆様が公開されているコードを参考にした箇所も含まれます。Androidアプリ開発の熟練者が書いたコードではありません。 エンジニア向け技術情報共有サービスではありませんので説明は省いています。ご了承ください。 GitHubなどへの公開は予定しておりません。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.32"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "jp.aosystem.cidr"
minSdkVersion 17
targetSdkVersion 30
multiDexEnabled true
versionCode 10
versionName "1.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-ads:20.1.0'
implementation 'com.android.support:multidex:1.0.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jp.aosystem.cidr">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Cidr">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SettingActivity" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-0000000000000000~0000000000">
</meta-data>
</application>
</manifest>
package jp.aosystem.cidr
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.os.LocaleList
import android.text.Editable
import android.text.TextWatcher
import android.util.DisplayMetrics
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.AdapterView
import android.widget.ArrayAdapter
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.constraintlayout.widget.ConstraintLayout
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.AdSize
import com.google.android.gms.ads.AdView
import com.google.android.gms.ads.MobileAds
import jp.aosystem.cidr.databinding.ActivityMainBinding
import java.util.*
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
private lateinit var viewModel: ConstraintLayout
private var inputMethodManager: InputMethodManager? = null
private var localeLanguage: String = ""
private var themeNumber: Int = 0 //0 or 1
//adMob
private lateinit var adView: AdView //adMob
private val adSize: AdSize
get() {
val display = windowManager.defaultDisplay
val outMetrics = DisplayMetrics()
display.getMetrics(outMetrics)
val density = outMetrics.density
var adWidthPixels = this.binding.adContainer.width.toFloat()
if (adWidthPixels == 0f) {
adWidthPixels = outMetrics.widthPixels.toFloat()
}
val adWidth = (adWidthPixels / density).toInt()
return AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(this, adWidth)
}
companion object {
private const val AD_UNIT_ID: String = "ca-app-pub-0000000000000000/0000000000" //adMob
private const val RESULT_SETTING_ACTIVITY: Int = 1
internal const val SETTINGS: String = "settings"
internal const val LOCALE_LANGUAGE: String = "localeLanguage"
internal const val THEME_NUMBER: String = "themeNumber"
}
private val netMasks = arrayListOf(
arrayListOf(0, 0, 0, 0),
arrayListOf(128, 0, 0, 0),
arrayListOf(192, 0, 0, 0),
arrayListOf(224, 0, 0, 0),
arrayListOf(240, 0, 0, 0),
arrayListOf(248, 0, 0, 0),
arrayListOf(252, 0, 0, 0),
arrayListOf(254, 0, 0, 0),
arrayListOf(255, 0, 0, 0),
arrayListOf(255, 128, 0, 0),
arrayListOf(255, 192, 0, 0),
arrayListOf(255, 224, 0, 0),
arrayListOf(255, 240, 0, 0),
arrayListOf(255, 248, 0, 0),
arrayListOf(255, 252, 0, 0),
arrayListOf(255, 254, 0, 0),
arrayListOf(255, 255, 0, 0),
arrayListOf(255, 255, 128, 0),
arrayListOf(255, 255, 192, 0),
arrayListOf(255, 255, 224, 0),
arrayListOf(255, 255, 240, 0),
arrayListOf(255, 255, 248, 0),
arrayListOf(255, 255, 252, 0),
arrayListOf(255, 255, 254, 0),
arrayListOf(255, 255, 255, 0),
arrayListOf(255, 255, 255, 128),
arrayListOf(255, 255, 255, 192),
arrayListOf(255, 255, 255, 224),
arrayListOf(255, 255, 255, 240),
arrayListOf(255, 255, 255, 248),
arrayListOf(255, 255, 255, 252),
arrayListOf(255, 255, 255, 254),
arrayListOf(255, 255, 255, 255),
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//setContentView(R.layout.activity_main)
this.binding = ActivityMainBinding.inflate(layoutInflater)
this.viewModel = this.binding.root
setContentView(this.viewModel)
//タイトルバー非表示
supportActionBar?.hide()
//テーマ読み込みと設定
this.loadThemeNumber()
this.setTheme()
//adMob
MobileAds.initialize(this) {}
this.adView = AdView(this)
this.binding.adContainer.addView(this.adView)
this.loadBanner()
//
this.setSpinner()
//背景タッチでテキストエリアからフォーカスを外してキーボードを隠す
this.setTouchListener()
//
this.binding.editTextIPAddr.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
this@MainActivity.calc()
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
}
private fun loadBanner() {
this.adView.adUnitId = AD_UNIT_ID
this.adView.adSize = adSize
// Create an ad request. Check your logcat output for the hashed device ID to
// get test ads on a physical device, e.g.,
// "Use AdRequest.Builder.addTestDevice("ABCDE0123") to get test ads on this device."
val adRequest = AdRequest
.Builder()
//.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build()
// Start loading the ad in the background.
this.adView.loadAd(adRequest)
}
//背景タッチでテキストエリアからフォーカスを外してキーボードを隠す
private fun setTouchListener() {
this.inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
this.binding.editTextIPAddr.setOnFocusChangeListener { _, hasFocus ->
if (!hasFocus) {
this.inputMethodManager!!.hideSoftInputFromWindow( //キーボードを隠す
this.binding.editTextIPAddr.windowToken,
InputMethodManager.HIDE_NOT_ALWAYS
)
}
}
}
private fun setSpinner() {
val adapter1 = ArrayAdapter<String>(this, android.R.layout.simple_spinner_item)
adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
adapter1.add("255.255.255.255 (/32) [1]")
adapter1.add("255.255.255.254 (/31) [2]")
adapter1.add("255.255.255.252 (/30) [4]")
adapter1.add("255.255.255.248 (/29) [8]")
adapter1.add("255.255.255.240 (/28) [16]")
adapter1.add("255.255.255.224 (/27) [32]")
adapter1.add("255.255.255.192 (/26) [64]")
adapter1.add("255.255.255.128 (/25) [128]")
adapter1.add("255.255.255.0 (/24) [256]")
adapter1.add("255.255.254.0 (/23) [512]")
adapter1.add("255.255.252.0 (/22) [1,024]")
adapter1.add("255.255.248.0 (/21) [2,048]")
adapter1.add("255.255.240.0 (/20) [4,096]")
adapter1.add("255.255.224.0 (/19) [8,192]")
adapter1.add("255.255.192.0 (/18) [16,384]")
adapter1.add("255.255.128.0 (/17) [32,768]")
adapter1.add("255.255.0.0 (/16) [65,536]")
adapter1.add("255.254.0.0 (/15) [131,072]")
adapter1.add("255.252.0.0 (/14) [262,144]")
adapter1.add("255.248.0.0 (/13) [524,288]")
adapter1.add("255.240.0.0 (/12) [1,048,576]")
adapter1.add("255.224.0.0 (/11) [2,097,152]")
adapter1.add("255.192.0.0 (/10) [4,194,304]")
adapter1.add("255.128.0.0 (/9) [8,388,608]")
adapter1.add("255.0.0.0 (/8) [16,777,216]")
adapter1.add("254.0.0.0 (/7) [33,554,432]")
adapter1.add("252.0.0.0 (/6) [67,108,864]")
adapter1.add("248.0.0.0 (/5) [134,217,728]")
adapter1.add("240.0.0.0 (/4) [268,435,456]")
adapter1.add("224.0.0.0 (/3) [536,870,912]")
adapter1.add("192.0.0.0 (/2) [1,073,741,824]")
adapter1.add("128.0.0.0 (/1) [2,147,483,648]")
this.binding.spinner1.adapter = adapter1
this.binding.spinner1.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
// アイテムが選択された時
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
//val spinnerParent = parent as Spinner
//val item = spinnerParent.selectedItem as String
this@MainActivity.calc()
}
// アイテムが選択されなかった
override fun onNothingSelected(parent: AdapterView<*>?) {
}
}
}
private fun calc() {
var ipAddress: String = this.binding.editTextIPAddr.text.toString()
if (ipAddress == "") {
ipAddress = "0"
}
val ips = "${ipAddress}.0.0.0.0".split('.')
val ipAry = arrayListOf(0, 0, 0, 0)
for (i in 0..3) {
ipAry[i] = "000${ips[i]}".takeLast(3).toIntOrNull() ?: 0
if (ipAry[i] < 0) {
ipAry[i] = 0
} else if (ipAry[i] > 255) {
ipAry[i] = 255
}
}
this.binding.textResult0.text = "${ipAry[0]}.${ipAry[1]}.${ipAry[2]}.${ipAry[3]}"
val subnet: Int = this.binding.spinner1.selectedItemId.toInt()
this.calc2(ipAry, subnet);
}
private fun calc2(ipAry: MutableList<Int>, subnet: Int) {
val maskXors = arrayListOf(0, 0, 0, 0)
val nets = arrayListOf(0, 0, 0, 0)
val netOrs = arrayListOf(0, 0, 0, 0)
val masks = arrayListOf(0, 0, 0, 0)
for (i in 0..3) {
masks[i] = this.netMasks[32 - subnet][i]
maskXors[i] = (255 - masks[i])
nets[i] = ipAry[i].and(masks[i])
netOrs[i] = nets[i].or(maskXors[i])
}
this.binding.textResult1.text = "${nets[0]}.${nets[1]}.${nets[2]}.${nets[3]} ~ ${netOrs[0]}.${netOrs[1]}.${netOrs[2]}.${netOrs[3]}"
this.binding.textResult2.text = "${nets[0]}.${nets[1]}.${nets[2]}.${nets[3]}"
if (nets[3] == netOrs[3]) {
this.binding.textResult3.text = "${nets[0]}.${nets[1]}.${nets[2]}.${nets[3]} (single)"
} else if ((nets[3] + 1) == netOrs[3]) {
this.binding.textResult3.text = "${nets[0]}.${nets[1]}.${nets[2]}.${nets[3]} ~ ${netOrs[0]}.${netOrs[1]}.${netOrs[2]}.${netOrs[3]} (two)"
} else {
this.binding.textResult3.text = "${nets[0]}.${nets[1]}.${nets[2]}.${nets[3] + 1} ~ ${netOrs[0]}.${netOrs[1]}.${netOrs[2]}.${netOrs[3] - 1}"
}
this.binding.textResult4.text = "${netOrs[0]}.${netOrs[1]}.${netOrs[2]}.${netOrs[3]}"
this.binding.textResult5.text = "${nets[0]}.${nets[1]}.${nets[2]}.${nets[3]}/${32 - subnet}"
this.binding.textResult6.text = "${masks[0]}.${masks[1]}.${masks[2]}.${masks[3]}"
this.binding.textResult7.text = "${this.to2(ipAry[0])}.${this.to2(ipAry[1])}.${this.to2(ipAry[2])}.${this.to2(ipAry[3])}"
this.binding.textResult8.text = "${this.to2(masks[0])}.${this.to2(masks[1])}.${this.to2(masks[2])}.${this.to2(masks[3])}"
}
private fun to2(num: Int): String {
val two = num.toString(2)
return ("00000000" + two).takeLast(8)
}
//--------------------------------------------------------------------------------
fun onClickSetting(v: View) {
val intent = Intent(applicationContext, SettingActivity::class.java)
intent.putExtra(LOCALE_LANGUAGE, this.localeLanguage)
intent.putExtra(THEME_NUMBER, this.themeNumber)
startActivityForResult(intent, RESULT_SETTING_ACTIVITY)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
super.onActivityResult(requestCode, resultCode, intent)
if (resultCode == Activity.RESULT_OK && requestCode == RESULT_SETTING_ACTIVITY && intent != null) {
var reCreateFlag: Boolean = false
val lastLocaleLanguage = this.localeLanguage
this.localeLanguage = intent.getStringExtra(LOCALE_LANGUAGE) ?: ""
if (this.localeLanguage != lastLocaleLanguage) {
this.saveLocaleLanguage()
reCreateFlag = true
}
val lastThemeNumber: Int = this.themeNumber
this.themeNumber = intent.getIntExtra(THEME_NUMBER, 0)
if (this.themeNumber != lastThemeNumber) {
this.saveThemeNumber()
reCreateFlag = true
}
if (reCreateFlag) {
recreate()
}
}
}
//--------------------------------------------------------------------------------
//テーマを保存
private fun saveThemeNumber() {
getSharedPreferences(SETTINGS, Context.MODE_PRIVATE).edit().apply {
putInt(THEME_NUMBER, this@MainActivity.themeNumber)
apply()
}
}
//テーマを読み出し
private fun loadThemeNumber() {
val pref = getSharedPreferences(SETTINGS, Context.MODE_PRIVATE)
this.themeNumber = pref.getInt(THEME_NUMBER, 0)
}
//テーマを設定
private fun setTheme() {
when (this.themeNumber) {
0 -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
1 -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
}
}
//--------------------------------------------------------------------------------
//localeLanguageを保存
private fun saveLocaleLanguage() {
getSharedPreferences(SETTINGS, Context.MODE_PRIVATE).edit().apply {
putString(LOCALE_LANGUAGE, this@MainActivity.localeLanguage)
apply()
}
}
//言語設定
override fun attachBaseContext(base: Context) {
val pref = base.getSharedPreferences(SETTINGS, Context.MODE_PRIVATE)
this.localeLanguage = pref.getString(LOCALE_LANGUAGE, "") ?: ""
var loc: Locale? = null
when (this.localeLanguage) {
"en" -> loc = Locale.ENGLISH
"ja" -> loc = Locale.JAPANESE
}
if (loc != null) {
val res = base.resources
val config = Configuration(res.configuration)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //minSdkVersion 24
val localeList = LocaleList(loc)
LocaleList.setDefault(localeList)
config.setLocales(localeList)
} else { //minSdkVersion 17 16はダメ
config.setLocale(loc)
}
super.attachBaseContext(base.createConfigurationContext(config))
} else {
super.attachBaseContext(base)
}
}
//--------------------------------------------------------------------------------
}
package jp.aosystem.cidr
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.os.LocaleList
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import jp.aosystem.cidr.databinding.ActivitySettingBinding
import java.util.*
class SettingActivity : AppCompatActivity() {
private lateinit var binding: ActivitySettingBinding
private lateinit var viewModel: ConstraintLayout
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//setContentView(R.layout.activity_main)
this.binding = ActivitySettingBinding.inflate(layoutInflater)
this.viewModel = this.binding.root
setContentView(this.viewModel)
//データ受け取り
val intent = this.intent
val localeLanguage: String = intent.getStringExtra(MainActivity.LOCALE_LANGUAGE) ?: ""
when (localeLanguage) {
"en" -> this.binding.radioEnglish.isChecked = true
"ja" -> this.binding.radioJapanese.isChecked = true
else -> this.binding.radioSystem.isChecked = true
}
val themeNumber: Int = intent.getIntExtra(MainActivity.THEME_NUMBER,0)
this.binding.switchTheme.isChecked = themeNumber != 0
//タイトルバー非表示
supportActionBar?.hide()
}
fun onClickApply(v: View) {
var localeLanguage: String = ""
if (this.binding.radioEnglish.isChecked) {
localeLanguage = "en"
} else if (this.binding.radioJapanese.isChecked) {
localeLanguage = "ja"
}
val themeNumber = if (this.binding.switchTheme.isChecked) 1 else 0
val intent = Intent()
intent.putExtra(MainActivity.LOCALE_LANGUAGE, localeLanguage)
intent.putExtra(MainActivity.THEME_NUMBER, themeNumber)
setResult(Activity.RESULT_OK, intent)
finish()
}
fun onClickCancel(v: View) {
val intent = Intent()
setResult(Activity.RESULT_CANCELED, intent)
finish()
}
//--------------------------------------------------------------------------------
//言語設定
override fun attachBaseContext(base: Context) {
val pref = base.getSharedPreferences(MainActivity.SETTINGS, Context.MODE_PRIVATE)
val localeLanguage: String = pref.getString(MainActivity.LOCALE_LANGUAGE, "") ?: ""
var loc: Locale? = null
when (localeLanguage) {
"ja" -> loc = Locale.JAPANESE
"en" -> loc = Locale.ENGLISH
}
if (loc != null) {
val res = base.resources
val config = Configuration(res.configuration)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //minSdkVersion 24
val localeList = LocaleList(loc)
LocaleList.setDefault(localeList)
config.setLocales(localeList)
} else { //minSdkVersion 17 16はダメ
config.setLocale(loc)
}
super.attachBaseContext(base.createConfigurationContext(config))
} else {
super.attachBaseContext(base)
}
}
//--------------------------------------------------------------------------------
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#c762b1"
android:focusable="true"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="auto"
android:focusableInTouchMode="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textTitle"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_weight="5"
android:background="#7462c5"
android:gravity="center"
android:text="@string/title" />
<TextView
android:id="@+id/textSetting"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_weight="1"
android:background="#9b62c5"
android:gravity="center"
android:onClick="onClickSetting"
android:text="@string/setting" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#6276c5"
android:orientation="horizontal"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="@string/input_ipaddr" />
<EditText
android:id="@+id/editTextIPAddr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:digits="0123456789."
android:ems="10"
android:hint="0.0.0.0"
android:inputType="numberDecimal" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#6093c5"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/input_subnetmask" />
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#5fb1c6"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label0" />
<TextView
android:id="@+id/textResult0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0.0.0"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#5dc6af"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label1" />
<TextView
android:id="@+id/textResult1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0.0.0 ~ 0.0.0.0"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#5dc674"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label2" />
<TextView
android:id="@+id/textResult2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0.0.0"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#86c663"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label3" />
<TextView
android:id="@+id/textResult3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0.0.0 (single)"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bfc663"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label4" />
<TextView
android:id="@+id/textResult4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0.0.0"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#c69d65"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label5" />
<TextView
android:id="@+id/textResult5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.0.0.0/32"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#c77c64"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label6" />
<TextView
android:id="@+id/textResult6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="255.255.255.255"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#c7627e"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView
android:id="@+id/textLabel7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label7" />
<TextView
android:id="@+id/textResult7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="00000000.00000000.00000000.00000000"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
<TextView
android:id="@+id/textResult8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="11111111.11111111.11111111.11111111"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="120dp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="@+id/ad_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SettingActivity">
<LinearLayout
android:id="@+id/layoutButtons"
android:layout_width="match_parent"
android:layout_height="48dip"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textCancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:background="#FDD835"
android:gravity="center"
android:minHeight="48dip"
android:onClick="onClickCancel"
android:text="@android:string/cancel" />
<TextView
android:id="@+id/textVerification"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:background="#C0CA33"
android:gravity="center"
android:minHeight="48dip"
android:onClick="onClickApply"
android:text="@string/apply" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/layoutButtons">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingTop="20dp"
android:paddingRight="20dp"
android:paddingBottom="50dp">
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switchTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/darkTheme" />
<View
android:id="@+id/divider1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="20dp"
android:background="?android:attr/listDivider" />
<TextView
android:id="@+id/textLanguage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/language"
android:textColor="?android:attr/textColorPrimary" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RadioButton
android:id="@+id/radioSystem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/system" />
<RadioButton
android:id="@+id/radioEnglish"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/english" />
<RadioButton
android:id="@+id/radioJapanese"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/japanese" />
</RadioGroup>
<View
android:id="@+id/divider2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="20dp"
android:background="?android:attr/listDivider" />
<Space
android:layout_width="match_parent"
android:layout_height="150dp" />
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>