Skip to content
Snippets Groups Projects
Commit 2ea5e5d6 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Implemented Account Setup UI

parent d82bf212
No related branches found
No related tags found
No related merge requests found
Showing
with 868 additions and 1 deletion
...@@ -51,6 +51,8 @@ android { ...@@ -51,6 +51,8 @@ android {
) )
} }
} }
vectorDrawables.useSupportLibrary = true
} }
buildTypes { buildTypes {
...@@ -75,6 +77,9 @@ dependencies { ...@@ -75,6 +77,9 @@ dependencies {
implementation(appCompat("customtabs")) implementation(appCompat("customtabs"))
implementation(appCompat("cardview-v7")) implementation(appCompat("cardview-v7"))
implementation(appCompat("recyclerview-v7")) implementation(appCompat("recyclerview-v7"))
implementation("com.android.support.constraint:constraint-layout:1.0.2")
implementation("com.github.apl-devs:appintro:v4.2.2")
implementation("io.reactivex.rxjava2:rxjava:2.1.3") implementation("io.reactivex.rxjava2:rxjava:2.1.3")
......
...@@ -19,9 +19,17 @@ ...@@ -19,9 +19,17 @@
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".ui.setup.AccountSetupActivity"
android:exported="true"
android:label="AccountSetup"
android:theme="@style/SplashTheme" />
<service <service
android:name=".service.QuasselService" android:name=".service.QuasselService"
android:description="@string/connection_service_description" android:description="@string/connection_service_description"
......
package de.kuschku.quasseldroid_ng.ui.setup
import android.os.Bundle
import de.kuschku.quasseldroid_ng.ui.setup.slides.AccountSetupConnectionSlide
import de.kuschku.quasseldroid_ng.ui.setup.slides.AccountSetupNameSlide
import de.kuschku.quasseldroid_ng.ui.setup.slides.AccountSetupUserSlide
class AccountSetupActivity : SetupActivity() {
override fun onDone(data: Bundle) {
}
override val fragments = listOf(
AccountSetupConnectionSlide(),
AccountSetupUserSlide(),
AccountSetupNameSlide()
)
}
package de.kuschku.quasseldroid_ng.ui.setup
import android.arch.lifecycle.MutableLiveData
import android.arch.lifecycle.Observer
import android.os.Bundle
import android.os.Parcelable
import android.support.design.widget.FloatingActionButton
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter
import android.support.v4.view.ViewPager
import android.support.v7.app.AppCompatActivity
import android.util.SparseArray
import android.view.ViewGroup
import butterknife.BindView
import butterknife.ButterKnife
import de.kuschku.quasseldroid_ng.R
import de.kuschku.quasseldroid_ng.ui.setup.slides.SlideFragment
import de.kuschku.quasseldroid_ng.util.helper.stickySwitchMapNotNull
abstract class SetupActivity : AppCompatActivity() {
@BindView(R.id.view_pager)
lateinit var viewPager: ViewPager
@BindView(R.id.next_button)
lateinit var button: FloatingActionButton
private lateinit var adapter: SlidePagerAdapter
protected abstract val fragments: List<SlideFragment>
private val currentPage = MutableLiveData<SlideFragment?>()
private val isValid = currentPage.stickySwitchMapNotNull(false, SlideFragment::valid)
private val pageChangeListener = object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) {
when (state) {
ViewPager.SCROLL_STATE_SETTLING -> pageChanged()
}
}
override fun onPageScrolled(position: Int, positionOffset: Float,
positionOffsetPixels: Int) = Unit
override fun onPageSelected(position: Int) = Unit
}
private fun pageChanged() {
currentPage.value = adapter.getItem(viewPager.currentItem)
val drawable = if (viewPager.currentItem == adapter.totalCount - 1)
R.drawable.ic_check
else
R.drawable.ic_arrow_right
button.setImageResource(drawable)
}
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.SetupTheme)
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_setup)
ButterKnife.bind(this)
adapter = SlidePagerAdapter(supportFragmentManager)
fragments.forEach(adapter::addFragment)
viewPager.adapter = adapter
button.setOnClickListener {
if (viewPager.currentItem == adapter.totalCount - 1)
onDoneInternal()
else
viewPager.setCurrentItem(viewPager.currentItem + 1, true)
}
isValid.observe(this, Observer {
if (it == true) {
button.show()
adapter.lastValidItem = viewPager.currentItem
} else {
button.hide()
adapter.lastValidItem = viewPager.currentItem - 1
}
})
viewPager.addOnPageChangeListener(pageChangeListener)
pageChanged()
}
private fun onDoneInternal() {
onDone(adapter.result)
}
abstract fun onDone(data: Bundle)
override fun onSaveInstanceState(outState: Bundle) {
outState.putInt("currentItem", viewPager.currentItem)
outState.putInt("lastValidItem", adapter.lastValidItem)
outState.putBundle("result", adapter.result)
super.onSaveInstanceState(outState)
}
override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
super.onRestoreInstanceState(savedInstanceState)
if (savedInstanceState != null) {
if (savedInstanceState.containsKey("result"))
adapter.result.putAll(savedInstanceState.getBundle("result"))
if (savedInstanceState.containsKey("lastValidItem"))
adapter.lastValidItem = savedInstanceState.getInt("lastValidItem")
if (savedInstanceState.containsKey("currentItem"))
viewPager.currentItem = savedInstanceState.getInt("currentItem")
currentPage.value = adapter.getItem(viewPager.currentItem)
}
pageChanged()
}
companion object {
private class SlidePagerAdapter(private val fragmentManager: FragmentManager) :
FragmentStatePagerAdapter(fragmentManager) {
private val retainedFragments = SparseArray<SlideFragment>()
val result = Bundle()
get() {
(0 until retainedFragments.size()).map(retainedFragments::valueAt).forEach {
it.getData(field)
}
return field
}
var lastValidItem = -1
set(value) {
field = value
notifyDataSetChanged()
}
private val list = mutableListOf<SlideFragment>()
override fun getItem(position: Int): SlideFragment {
return retainedFragments.get(position) ?: list[position]
}
override fun getCount() = Math.min(list.size, lastValidItem + 2)
val totalCount get() = list.size
fun addFragment(fragment: SlideFragment) {
list.add(fragment)
}
override fun instantiateItem(container: ViewGroup?, position: Int): Any {
val fragment = super.instantiateItem(container, position)
retainedFragments.put(position, fragment as SlideFragment)
return fragment
}
override fun destroyItem(container: ViewGroup?, position: Int, `object`: Any?) {
retainedFragments.get(position)?.getData(result)
retainedFragments.remove(position)
super.destroyItem(container, position, `object`)
}
override fun restoreState(state: Parcelable?, loader: ClassLoader?) {
super.restoreState(state, loader)
if (state != null) {
val bundle = state as Bundle
val keys = bundle.keySet()
for (key in keys) {
if (key.startsWith("f")) {
val index = Integer.parseInt(key.substring(1))
val f = fragmentManager.getFragment(bundle, key)
if (f != null && f is SlideFragment) {
retainedFragments.put(index, f)
}
}
}
}
}
}
}
}
package de.kuschku.quasseldroid_ng.ui.setup.slides
import android.os.Bundle
import android.support.design.widget.TextInputEditText
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.BindView
import butterknife.ButterKnife
import de.kuschku.quasseldroid_ng.R
class AccountSetupConnectionSlide : SlideFragment() {
@BindView(R.id.host)
lateinit var hostField: TextInputEditText
@BindView(R.id.port)
lateinit var portField: TextInputEditText
private val textWatcher = object : TextWatcher {
override fun afterTextChanged(p0: Editable?) = updateValidity()
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) = Unit
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) = Unit
}
override fun isValid(): Boolean {
return validHost() && validPort()
}
override val title = R.string.slideAccountConnectionTitle
override val descripion = R.string.slideAccountConnectionDescription
override fun setData(data: Bundle) {
if (data.containsKey("host"))
hostField.setText(data.getString("host"))
if (data.containsKey("port"))
portField.setText(data.getInt("port").toString())
updateValidity()
}
override fun getData(data: Bundle) {
data.putString("host", hostField.text.toString())
data.putInt("port", portField.text.toString().toIntOrNull() ?: -1)
}
override fun onCreateContent(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
val view = inflater.inflate(R.layout.setup_account_connection, container, false)
ButterKnife.bind(this, view)
hostField.addTextChangedListener(textWatcher)
portField.addTextChangedListener(textWatcher)
return view
}
override fun onDestroyView() {
hostField.removeTextChangedListener(textWatcher)
portField.removeTextChangedListener(textWatcher)
super.onDestroyView()
}
private fun validHost() = hostField.text.isNotEmpty()
private fun validPort() = (0 until 65536).contains(portField.text.toString().toIntOrNull())
}
package de.kuschku.quasseldroid_ng.ui.setup.slides
import android.os.Bundle
import android.support.design.widget.TextInputEditText
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.BindView
import butterknife.ButterKnife
import de.kuschku.quasseldroid_ng.R
class AccountSetupNameSlide : SlideFragment() {
@BindView(R.id.name)
lateinit var nameField: TextInputEditText
private val textWatcher = object : TextWatcher {
override fun afterTextChanged(p0: Editable?) = updateValidity()
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) = Unit
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) = Unit
}
override fun isValid(): Boolean {
return validName()
}
override val title = R.string.slideAccountNameTitle
override val descripion = R.string.slideAccountNameDescription
override fun setData(data: Bundle) {
if (data.containsKey("name"))
nameField.setText(data.getString("name"))
updateValidity()
}
override fun getData(data: Bundle) {
data.putString("name", nameField.text.toString())
}
override fun onCreateContent(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
val view = inflater.inflate(R.layout.setup_account_name, container, false)
ButterKnife.bind(this, view)
nameField.addTextChangedListener(textWatcher)
return view
}
override fun onDestroyView() {
nameField.removeTextChangedListener(textWatcher)
super.onDestroyView()
}
private fun validName() = nameField.text.isNotEmpty()
}
package de.kuschku.quasseldroid_ng.ui.setup.slides
import android.os.Bundle
import android.support.design.widget.TextInputEditText
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import butterknife.BindView
import butterknife.ButterKnife
import de.kuschku.quasseldroid_ng.R
class AccountSetupUserSlide : SlideFragment() {
@BindView(R.id.user)
lateinit var userField: TextInputEditText
@BindView(R.id.pass)
lateinit var passField: TextInputEditText
private val textWatcher = object : TextWatcher {
override fun afterTextChanged(p0: Editable?) = updateValidity()
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) = Unit
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) = Unit
}
override fun isValid(): Boolean {
return validUser() && validPass()
}
override val title = R.string.slideAccountUserTitle
override val descripion = R.string.slideAccountUserDescription
override fun setData(data: Bundle) {
if (data.containsKey("user"))
userField.setText(data.getString("user"))
if (data.containsKey("pass"))
passField.setText(data.getString("pass"))
}
override fun getData(data: Bundle) {
data.putString("user", userField.text.toString())
data.putString("pass", passField.text.toString())
}
override fun onCreateContent(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
val view = inflater.inflate(R.layout.setup_account_user, container, false)
ButterKnife.bind(this, view)
userField.addTextChangedListener(textWatcher)
passField.addTextChangedListener(textWatcher)
return view
}
override fun onDestroyView() {
userField.removeTextChangedListener(textWatcher)
passField.removeTextChangedListener(textWatcher)
super.onDestroyView()
}
private fun validUser() = userField.text.isNotEmpty()
private fun validPass() = passField.text.isNotEmpty()
}
package de.kuschku.quasseldroid_ng.ui.setup.slides
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.MutableLiveData
import android.arch.lifecycle.Observer
import android.os.Bundle
import android.support.annotation.StringRes
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import de.kuschku.quasseldroid_ng.R
abstract class SlideFragment : Fragment() {
@get:StringRes
protected abstract val title: Int
@get:StringRes
protected abstract val descripion: Int
protected abstract fun isValid(): Boolean
val valid = object : MutableLiveData<Boolean>() {
override fun observe(owner: LifecycleOwner?, observer: Observer<Boolean>?) {
super.observe(owner, observer)
observer?.onChanged(value)
}
override fun observeForever(observer: Observer<Boolean>?) {
super.observeForever(observer)
observer?.onChanged(value)
}
}
protected fun updateValidity() {
val valid1 = isValid()
println("Updating validity: ${this::class.java.simpleName}@${hashCode()} $valid1")
valid.value = valid1
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View {
val view = inflater.inflate(R.layout.setup_slide, container, false)
val viewGroup = view.findViewById<View>(R.id.content_host) as ViewGroup
viewGroup.addView(onCreateContent(inflater, viewGroup, savedInstanceState))
view.findViewById<TextView>(R.id.title).setText(title)
view.findViewById<TextView>(R.id.description).setText(descripion)
if (savedInstanceState != null)
setData(savedInstanceState)
updateValidity()
return view
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
getData(outState)
}
override fun onViewStateRestored(savedInstanceState: Bundle?) {
super.onViewStateRestored(savedInstanceState)
updateValidity()
}
abstract fun setData(data: Bundle)
abstract fun getData(data: Bundle)
protected abstract fun onCreateContent(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View
}
package de.kuschku.quasseldroid_ng.ui.setup.slides
interface ValidityChangeCallback {
fun invoke(isValid: Boolean)
}
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_marginBottom="16dp"
android:layout_marginEnd="80dp"
android:layout_marginRight="80dp"
android:tint="#ffffff"
app:backgroundTint="#8A000000"
app:elevation="0dip"
app:fabSize="normal"
app:pressedTranslationZ="0dip" />
</merge>
<?xml version="1.0" encoding="utf-8"?><!--
~ QuasselDroid - Quassel client for Android
~ Copyright (C) 2016 Janne Koschinski
~ Copyright (C) 2016 Ken Børge Viktil
~ Copyright (C) 2016 Magnus Fjell
~ Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
~
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, either version 3 of the License, or (at your option)
~ any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="64dp"
android:paddingRight="64dp">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/view"
android:layout_toLeftOf="@+id/scrollView"
android:layout_toStartOf="@+id/scrollView"
android:gravity="end"
android:paddingEnd="64dp"
android:paddingRight="64dp"
android:textSize="28sp"
android:theme="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
tools:text="Connection" />
<android.support.v4.widget.Space
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/scrollView"
android:layout_toStartOf="@+id/scrollView" />
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/view"
android:layout_toLeftOf="@+id/scrollView"
android:layout_toStartOf="@+id/scrollView"
android:gravity="end"
android:paddingEnd="64dp"
android:paddingRight="64dp"
android:textSize="16sp"
android:theme="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse"
tools:text="First, please choose which server your core is hosted on." />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true">
<android.support.v7.widget.CardView
android:id="@+id/content_host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="400dp" />
</ScrollView>
</RelativeLayout>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center">
<android.support.design.widget.FloatingActionButton
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:tint="#ffffff"
app:backgroundTint="#8A000000"
app:elevation="0dip"
app:fabSize="normal"
app:pressedTranslationZ="0dip" />
</FrameLayout>
</merge>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:orientation="vertical"
android:padding="32dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="Connection"
android:textSize="28sp"
android:theme="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse" />
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:theme="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse"
tools:text="First, please choose which server your core is hosted on." />
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/content_host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="400dp" />
</LinearLayout>
</ScrollView>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:tint="#ffffff"
app:backgroundTint="#8A808080"
app:elevation="0dip"
app:fabSize="normal"
app:pressedTranslationZ="0dip" />
</merge>
<?xml version="1.0" encoding="utf-8"?><!--
~ QuasselDroid - Quassel client for Android
~ Copyright (C) 2016 Janne Koschinski
~ Copyright (C) 2016 Ken Børge Viktil
~ Copyright (C) 2016 Magnus Fjell
~ Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
~
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, either version 3 of the License, or (at your option)
~ any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="32dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/labelConnectionHostname">
<android.support.design.widget.TextInputEditText
android:id="@+id/host"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textUri" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/labelConnectionPort">
<android.support.design.widget.TextInputEditText
android:id="@+id/port"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:text="@string/defaultConnectionPort" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?><!--
~ QuasselDroid - Quassel client for Android
~ Copyright (C) 2016 Janne Koschinski
~ Copyright (C) 2016 Ken Børge Viktil
~ Copyright (C) 2016 Magnus Fjell
~ Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
~
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, either version 3 of the License, or (at your option)
~ any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="32dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/labelAccountName">
<android.support.design.widget.TextInputEditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?><!--
~ QuasselDroid - Quassel client for Android
~ Copyright (C) 2016 Janne Koschinski
~ Copyright (C) 2016 Ken Børge Viktil
~ Copyright (C) 2016 Magnus Fjell
~ Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
~
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, either version 3 of the License, or (at your option)
~ any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="32dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/labelAccountUsername">
<android.support.design.widget.TextInputEditText
android:id="@+id/user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textVisiblePassword|textNoSuggestions" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/labelAccountPassword">
<android.support.design.widget.TextInputEditText
android:id="@+id/pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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="?attr/colorPrimary"
android:orientation="vertical"
android:padding="32dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:textSize="28sp"
android:theme="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
tools:text="Connection" />
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:theme="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse"
tools:text="First, please choose which server your core is hosted on." />
</LinearLayout>
<FrameLayout
android:id="@+id/content_host"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</ScrollView>
<resources>
<style name="SetupTheme" parent="AppTheme.NoActionBar">
<item name="android:windowBackground">?attr/colorPrimary</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#0a70c0</color> <color name="colorPrimary">#ca241f</color>
<color name="colorPrimaryDark">#105a94</color> <color name="colorPrimaryDark">#105a94</color>
<color name="colorAccent">#ffaf3b</color> <color name="colorAccent">#ffaf3b</color>
<attr name="backgroundSetup">?attr/color</attr>
</resources> </resources>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment