Skip to content

Commit

Permalink
Add version and build code to Rate or Share fragment.
Browse files Browse the repository at this point in the history
  • Loading branch information
iiordanov committed Jan 20, 2024
1 parent 86cf13e commit 7657fb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TableLayout
import android.widget.TextView
import androidx.fragment.app.DialogFragment
import com.iiordanov.bVNC.Utils
import com.undatech.remoteClientUi.R
Expand All @@ -33,6 +34,7 @@ class RateOrShareFragment : DialogFragment() {
private var layout: TableLayout? = null
private var donationButton: Button? = null
private var previousVersionsButton: Button? = null
private var versionAndCode: TextView? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -48,14 +50,17 @@ class RateOrShareFragment : DialogFragment() {
dialog?.setTitle(getString(R.string.action_rate_or_share_app))
val v = inflater.inflate(R.layout.rateorshare, container, false)
layout = v.findViewById<View>(R.id.layout) as TableLayout
donationButton = v.findViewById<Button>(R.id.buttonDonate);
previousVersionsButton = v.findViewById<Button>(R.id.buttonPreviousVersions);
donationButton = v.findViewById(R.id.buttonDonate);
previousVersionsButton = v.findViewById(R.id.buttonPreviousVersions);
if (!Utils.isFree(activity)) {
donationButton?.visibility = View.GONE
}
if (Utils.isOpaque(activity)) {
previousVersionsButton?.visibility = View.GONE
}
versionAndCode = v.findViewById<View>(R.id.versionAndCode) as TextView
versionAndCode?.text = Utils.getVersionAndCode(v.context)

return v
}

Expand Down
10 changes: 10 additions & 0 deletions bVNC/src/main/res/layout/rateorshare.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,15 @@
</TableRow>

<TableRow android:gravity="center" />

<TableRow android:gravity="center">

<TextView
android:id="@+id/versionAndCode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" />

</TableRow>
</TableLayout>
</ScrollView>

0 comments on commit 7657fb4

Please sign in to comment.