ObjectivesFragment -> jetpack

This commit is contained in:
Milos Kozak 2021-01-24 16:16:07 +01:00
parent fcf67cd014
commit 55da01d4a9
3 changed files with 108 additions and 112 deletions

View file

@ -9,8 +9,6 @@ import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
@ -19,11 +17,13 @@ import androidx.recyclerview.widget.LinearSmoothScroller
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ObjectivesFragmentBinding
import info.nightscout.androidaps.databinding.ObjectivesItemBinding
import info.nightscout.androidaps.dialogs.NtpProgressDialog
import info.nightscout.androidaps.events.EventNtpStatus
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog
import info.nightscout.androidaps.dialogs.NtpProgressDialog
import info.nightscout.androidaps.events.EventNtpStatus
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask
import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.receivers.ReceiverStatusStore
@ -31,17 +31,17 @@ import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.SntpClient import info.nightscout.androidaps.utils.SntpClient
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.extensions.plusAssign import info.nightscout.androidaps.utils.extensions.plusAssign
import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP import info.nightscout.androidaps.utils.sharedPreferences.SP
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.objectives_fragment.*
import javax.inject.Inject import javax.inject.Inject
class ObjectivesFragment : DaggerFragment() { class ObjectivesFragment : DaggerFragment() {
@Inject lateinit var rxBus: RxBusWrapper @Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var aapsLogger: AAPSLogger
@Inject lateinit var sp: SP @Inject lateinit var sp: SP
@ -64,19 +64,26 @@ class ObjectivesFragment : DaggerFragment() {
} }
} }
private var _binding: ObjectivesFragmentBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? { savedInstanceState: Bundle?): View {
return inflater.inflate(R.layout.objectives_fragment, container, false) _binding = ObjectivesFragmentBinding.inflate(inflater, container, false)
return binding.root
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
objectives_recyclerview.layoutManager = LinearLayoutManager(view.context) binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
objectives_recyclerview.adapter = objectivesAdapter binding.recyclerview.adapter = objectivesAdapter
objectives_fake.setOnClickListener { updateGUI() } binding.fake.setOnClickListener { updateGUI() }
objectives_reset.setOnClickListener { binding.reset.setOnClickListener {
objectivesPlugin.reset() objectivesPlugin.reset()
objectives_recyclerview.adapter?.notifyDataSetChanged() binding.recyclerview.adapter?.notifyDataSetChanged()
scrollToCurrentObjective() scrollToCurrentObjective()
} }
scrollToCurrentObjective() scrollToCurrentObjective()
@ -90,7 +97,7 @@ class ObjectivesFragment : DaggerFragment() {
.toObservable(EventObjectivesUpdateGui::class.java) .toObservable(EventObjectivesUpdateGui::class.java)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
objectives_recyclerview.adapter?.notifyDataSetChanged() binding.recyclerview.adapter?.notifyDataSetChanged()
}, { fabricPrivacy.logException(it) } }, { fabricPrivacy.logException(it) }
) )
} }
@ -105,6 +112,7 @@ class ObjectivesFragment : DaggerFragment() {
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
handler.removeCallbacks(objectiveUpdater) handler.removeCallbacks(objectiveUpdater)
_binding = null
} }
private fun startUpdateTimer() { private fun startUpdateTimer() {
@ -129,7 +137,7 @@ class ObjectivesFragment : DaggerFragment() {
override fun calculateTimeForScrolling(dx: Int): Int = super.calculateTimeForScrolling(dx) * 4 override fun calculateTimeForScrolling(dx: Int): Int = super.calculateTimeForScrolling(dx) * 4
} }
smoothScroller.targetPosition = i smoothScroller.targetPosition = i
objectives_recyclerview.layoutManager?.startSmoothScroll(smoothScroller) binding.recyclerview.layoutManager?.startSmoothScroll(smoothScroller)
} }
break break
} }
@ -145,67 +153,66 @@ class ObjectivesFragment : DaggerFragment() {
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val objective = objectivesPlugin.objectives[position] val objective = objectivesPlugin.objectives[position]
holder.title.text = resourceHelper.gs(R.string.nth_objective, position + 1) holder.binding.title.text = resourceHelper.gs(R.string.nth_objective, position + 1)
if (objective.objective != 0) { if (objective.objective != 0) {
holder.objective.visibility = View.VISIBLE holder.binding.objective.visibility = View.VISIBLE
holder.objective.text = resourceHelper.gs(objective.objective) holder.binding.objective.text = resourceHelper.gs(objective.objective)
} else } else
holder.objective.visibility = View.GONE holder.binding.objective.visibility = View.GONE
if (objective.gate != 0) { if (objective.gate != 0) {
holder.gate.visibility = View.VISIBLE holder.binding.gate.visibility = View.VISIBLE
holder.gate.text = resourceHelper.gs(objective.gate) holder.binding.gate.text = resourceHelper.gs(objective.gate)
} else } else
holder.gate.visibility = View.GONE holder.binding.gate.visibility = View.GONE
if (!objective.isStarted) { if (!objective.isStarted) {
holder.gate.setTextColor(-0x1) holder.binding.gate.setTextColor(-0x1)
holder.verify.visibility = View.GONE holder.binding.verify.visibility = View.GONE
holder.progress.visibility = View.GONE holder.binding.progress.visibility = View.GONE
holder.accomplished.visibility = View.GONE holder.binding.accomplished.visibility = View.GONE
holder.unFinish.visibility = View.GONE holder.binding.unfinish.visibility = View.GONE
holder.unStart.visibility = View.GONE holder.binding.unstart.visibility = View.GONE
if (position == 0 || objectivesPlugin.allPriorAccomplished(position)) if (position == 0 || objectivesPlugin.allPriorAccomplished(position))
holder.start.visibility = View.VISIBLE holder.binding.start.visibility = View.VISIBLE
else else
holder.start.visibility = View.GONE holder.binding.start.visibility = View.GONE
} else if (objective.isAccomplished) { } else if (objective.isAccomplished) {
holder.gate.setTextColor(-0xb350b0) holder.binding.gate.setTextColor(-0xb350b0)
holder.verify.visibility = View.GONE holder.binding.verify.visibility = View.GONE
holder.progress.visibility = View.GONE holder.binding.progress.visibility = View.GONE
holder.start.visibility = View.GONE holder.binding.start.visibility = View.GONE
holder.accomplished.visibility = View.VISIBLE holder.binding.accomplished.visibility = View.VISIBLE
holder.unFinish.visibility = View.VISIBLE holder.binding.unfinish.visibility = View.VISIBLE
holder.unStart.visibility = View.GONE holder.binding.unstart.visibility = View.GONE
} else if (objective.isStarted) { } else if (objective.isStarted) {
holder.gate.setTextColor(-0x1) holder.binding.gate.setTextColor(-0x1)
holder.verify.visibility = View.VISIBLE holder.binding.verify.visibility = View.VISIBLE
holder.verify.isEnabled = objective.isCompleted || objectives_fake.isChecked holder.binding.verify.isEnabled = objective.isCompleted || binding.fake.isChecked
holder.start.visibility = View.GONE holder.binding.start.visibility = View.GONE
holder.accomplished.visibility = View.GONE holder.binding.accomplished.visibility = View.GONE
holder.unFinish.visibility = View.GONE holder.binding.unfinish.visibility = View.GONE
holder.unStart.visibility = View.VISIBLE holder.binding.unstart.visibility = View.VISIBLE
holder.progress.visibility = View.VISIBLE holder.binding.progress.visibility = View.VISIBLE
holder.progress.removeAllViews() holder.binding.progress.removeAllViews()
for (task in objective.tasks) { for (task in objective.tasks) {
if (task.shouldBeIgnored()) continue if (task.shouldBeIgnored()) continue
// name // name
val name = TextView(holder.progress.context) val name = TextView(holder.binding.progress.context)
@Suppress("SetTextlI8n")
name.text = resourceHelper.gs(task.task) + ":" name.text = resourceHelper.gs(task.task) + ":"
name.setTextColor(-0x1) name.setTextColor(-0x1)
holder.progress.addView(name, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT) holder.binding.progress.addView(name, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
// hint // hint
task.hints.forEach { h -> task.hints.forEach { h ->
if (!task.isCompleted) if (!task.isCompleted)
holder.progress.addView(h.generate(context)) holder.binding.progress.addView(h.generate(context))
} }
// state // state
val state = TextView(holder.progress.context) val state = TextView(holder.binding.progress.context)
state.setTextColor(-0x1) state.setTextColor(-0x1)
val basicHTML = "<font color=\"%1\$s\"><b>%2\$s</b></font>" val basicHTML = "<font color=\"%1\$s\"><b>%2\$s</b></font>"
val formattedHTML = String.format(basicHTML, if (task.isCompleted) "#4CAF50" else "#FF9800", task.progress) val formattedHTML = String.format(basicHTML, if (task.isCompleted) "#4CAF50" else "#FF9800", task.progress)
state.text = HtmlHelper.fromHtml(formattedHTML) state.text = HtmlHelper.fromHtml(formattedHTML)
state.gravity = Gravity.END state.gravity = Gravity.END
holder.progress.addView(state, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT) holder.binding.progress.addView(state, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
if (task is ExamTask) { if (task is ExamTask) {
state.setOnClickListener { state.setOnClickListener {
val dialog = ObjectivesExamDialog() val dialog = ObjectivesExamDialog()
@ -218,16 +225,16 @@ class ObjectivesFragment : DaggerFragment() {
} }
} }
// horizontal line // horizontal line
val separator = View(holder.progress.context) val separator = View(holder.binding.progress.context)
separator.setBackgroundColor(Color.DKGRAY) separator.setBackgroundColor(Color.DKGRAY)
holder.progress.addView(separator, LinearLayout.LayoutParams.MATCH_PARENT, 2) holder.binding.progress.addView(separator, LinearLayout.LayoutParams.MATCH_PARENT, 2)
} }
} }
holder.accomplished.text = resourceHelper.gs(R.string.accomplished, dateUtil.dateAndTimeString(objective.accomplishedOn)) holder.binding.accomplished.text = resourceHelper.gs(R.string.accomplished, dateUtil.dateAndTimeString(objective.accomplishedOn))
holder.accomplished.setTextColor(-0x3e3e3f) holder.binding.accomplished.setTextColor(-0x3e3e3f)
holder.verify.setOnClickListener { holder.binding.verify.setOnClickListener {
receiverStatusStore.updateNetworkStatus() receiverStatusStore.updateNetworkStatus()
if (objectives_fake.isChecked) { if (binding.fake.isChecked) {
objective.accomplishedOn = DateUtil.now() objective.accomplishedOn = DateUtil.now()
scrollToCurrentObjective() scrollToCurrentObjective()
startUpdateTimer() startUpdateTimer()
@ -264,9 +271,9 @@ class ObjectivesFragment : DaggerFragment() {
}.start() }.start()
} }
} }
holder.start.setOnClickListener { holder.binding.start.setOnClickListener {
receiverStatusStore.updateNetworkStatus() receiverStatusStore.updateNetworkStatus()
if (objectives_fake.isChecked) { if (binding.fake.isChecked) {
objective.startedOn = DateUtil.now() objective.startedOn = DateUtil.now()
scrollToCurrentObjective() scrollToCurrentObjective()
startUpdateTimer() startUpdateTimer()
@ -298,7 +305,7 @@ class ObjectivesFragment : DaggerFragment() {
}, receiverStatusStore.isConnected) }, receiverStatusStore.isConnected)
}.start() }.start()
} }
holder.unStart.setOnClickListener { holder.binding.unstart.setOnClickListener {
activity?.let { activity -> activity?.let { activity ->
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.objectives), resourceHelper.gs(R.string.doyouwantresetstart), Runnable { OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.objectives), resourceHelper.gs(R.string.doyouwantresetstart), Runnable {
objective.startedOn = 0 objective.startedOn = 0
@ -308,7 +315,7 @@ class ObjectivesFragment : DaggerFragment() {
}) })
} }
} }
holder.unFinish.setOnClickListener { holder.binding.unfinish.setOnClickListener {
objective.accomplishedOn = 0 objective.accomplishedOn = 0
scrollToCurrentObjective() scrollToCurrentObjective()
rxBus.send(EventObjectivesUpdateGui()) rxBus.send(EventObjectivesUpdateGui())
@ -318,21 +325,21 @@ class ObjectivesFragment : DaggerFragment() {
// generate random request code if none exists // generate random request code if none exists
val request = sp.getString(R.string.key_objectives_request_code, String.format("%1$05d", (Math.random() * 99999).toInt())) val request = sp.getString(R.string.key_objectives_request_code, String.format("%1$05d", (Math.random() * 99999).toInt()))
sp.putString(R.string.key_objectives_request_code, request) sp.putString(R.string.key_objectives_request_code, request)
holder.requestCode.text = resourceHelper.gs(R.string.requestcode, request) holder.binding.requestcode.text = resourceHelper.gs(R.string.requestcode, request)
holder.requestCode.visibility = View.VISIBLE holder.binding.requestcode.visibility = View.VISIBLE
holder.enterButton.visibility = View.VISIBLE holder.binding.enterbutton.visibility = View.VISIBLE
holder.input.visibility = View.VISIBLE holder.binding.input.visibility = View.VISIBLE
holder.inputHint.visibility = View.VISIBLE holder.binding.inputhint.visibility = View.VISIBLE
holder.enterButton.setOnClickListener { holder.binding.enterbutton.setOnClickListener {
val input = holder.input.text.toString() val input = holder.binding.input.text.toString()
objective.specialAction(activity, input) objective.specialAction(activity, input)
rxBus.send(EventObjectivesUpdateGui()) rxBus.send(EventObjectivesUpdateGui())
} }
} else { } else {
holder.enterButton.visibility = View.GONE holder.binding.enterbutton.visibility = View.GONE
holder.input.visibility = View.GONE holder.binding.input.visibility = View.GONE
holder.inputHint.visibility = View.GONE holder.binding.inputhint.visibility = View.GONE
holder.requestCode.visibility = View.GONE holder.binding.requestcode.visibility = View.GONE
} }
} }
@ -340,20 +347,9 @@ class ObjectivesFragment : DaggerFragment() {
return objectivesPlugin.objectives.size return objectivesPlugin.objectives.size
} }
inner class ViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val title: TextView = itemView.findViewById(R.id.objective_title)
val objective: TextView = itemView.findViewById(R.id.objective_objective) val binding = ObjectivesItemBinding.bind(itemView)
val gate: TextView = itemView.findViewById(R.id.objective_gate)
val accomplished: TextView = itemView.findViewById(R.id.objective_accomplished)
val progress: LinearLayout = itemView.findViewById(R.id.objective_progress)
val verify: Button = itemView.findViewById(R.id.objective_verify)
val start: Button = itemView.findViewById(R.id.objective_start)
val unFinish: Button = itemView.findViewById(R.id.objective_unfinish)
val unStart: Button = itemView.findViewById(R.id.objective_unstart)
val inputHint: TextView = itemView.findViewById(R.id.objective_inputhint)
val input: EditText = itemView.findViewById(R.id.objective_input)
val enterButton: Button = itemView.findViewById(R.id.objective_enterbutton)
val requestCode: TextView = itemView.findViewById(R.id.objective_requestcode)
} }
} }

View file

@ -16,7 +16,7 @@
android:visibility="gone"> android:visibility="gone">
<CheckBox <CheckBox
android:id="@+id/objectives_fake" android:id="@+id/fake"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
@ -24,7 +24,7 @@
android:text="Enable fake time and progress" /> android:text="Enable fake time and progress" />
<Button <Button
android:id="@+id/objectives_reset" android:id="@+id/reset"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -32,7 +32,7 @@
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/objectives_recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"

View file

@ -6,8 +6,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
app:cardBackgroundColor="@color/colorPrimary" app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="2dp" app:cardCornerRadius="2dp"
app:cardUseCompatPadding="true" app:cardUseCompatPadding="true"
@ -19,7 +19,7 @@
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/objective_title" android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium" android:fontFamily="sans-serif-medium"
@ -28,7 +28,7 @@
tools:text="1. Title" /> tools:text="1. Title" />
<TextView <TextView
android:id="@+id/objective_objective" android:id="@+id/objective"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
@ -36,7 +36,7 @@
tools:text="Objective" /> tools:text="Objective" />
<TextView <TextView
android:id="@+id/objective_gate" android:id="@+id/gate"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
@ -45,50 +45,50 @@
tools:text="Gate" /> tools:text="Gate" />
<LinearLayout <LinearLayout
android:id="@+id/objective_progress" android:id="@+id/progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:orientation="vertical" > android:orientation="vertical">
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/objective_verify" android:id="@+id/verify"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/objectives_button_verify" /> android:text="@string/objectives_button_verify" />
<Button <Button
android:id="@+id/objective_start" android:id="@+id/start"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/objectives_button_start" /> android:text="@string/objectives_button_start" />
<Button <Button
android:id="@+id/objective_unfinish" android:id="@+id/unfinish"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/objectives_button_unfinish" /> android:text="@string/objectives_button_unfinish" />
<Button <Button
android:id="@+id/objective_unstart" android:id="@+id/unstart"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/objectives_button_unstart" /> android:text="@string/objectives_button_unstart" />
<TextView <TextView
android:id="@+id/objective_inputhint" android:id="@+id/inputhint"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/enter_code_obtained_from_developers_to_bypass_the_rest_of_objectives" /> android:text="@string/enter_code_obtained_from_developers_to_bypass_the_rest_of_objectives" />
<TextView <TextView
android:id="@+id/objective_requestcode" android:id="@+id/requestcode"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Request code: XXXXX" /> android:text="Request code: XXXXX" />
@ -96,10 +96,10 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" > android:orientation="horizontal">
<EditText <EditText
android:id="@+id/objective_input" android:id="@+id/input"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
@ -108,7 +108,7 @@
android:inputType="text" /> android:inputType="text" />
<Button <Button
android:id="@+id/objective_enterbutton" android:id="@+id/enterbutton"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -117,7 +117,7 @@
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/objective_accomplished" android:id="@+id/accomplished"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"