This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
... |
This file contains hidden or 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
class MainActivity : AppCompatActivity() { | |
lateinit var binding: ActivityMainBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = DataBindingUtil.setContentView(this, R.layout.activity_main) | |
} | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | |
<data> | |
<variable | |
name="name" | |
type="String" /> | |
</data> | |
<LinearLayout |
This file contains hidden or 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
class MainActivity : AppCompatActivity() { | |
lateinit var binding: ActivityMainBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
binding = DataBindingUtil.setContentView(this, R.layout.activity_main) | |
binding.buttonContinue.setOnClickListener { | |
binding.name = Random.nextInt(100).toString() | |
} |
This file contains hidden or 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
object ViewBindingAdapter { | |
@BindingAdapter("visibilityGone") | |
@JvmStatic | |
fun visibilityGone(view: View, isShouldGone: Boolean) { | |
if (isShouldGone) { | |
view.visibility = View.GONE | |
} else { | |
view.visibility = View.VISIBLE | |
} | |
} |
This file contains hidden or 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
<TextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingTop="16dp" | |
android:text="@{name}" | |
visibilityGone="@{name == null}"/> |
This file contains hidden or 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
binding.buttonReset.setOnClickListener { | |
binding.name = null | |
} |
This file contains hidden or 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
<com.google.android.material.button.MaterialButton | |
android:id="@+id/button_reset" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="8dp" | |
style="@style/Widget.MaterialComponents.Button.OutlinedButton" | |
android:text="Reset" /> |
This file contains hidden or 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
#!/usr/bin/env kotlin | |
import java.io.File | |
import java.nio.file.Files | |
import java.nio.file.Path | |
import java.nio.file.Paths | |
/** | |
* How to use: | |
* Run script |
This file contains hidden or 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
echo "This script will copy the WordPress installation into" | |
echo "/var/www/yourNewSubDomain/html" | |
echo "--------------------------------------------------" | |
echo "This setup requires a domain name. If you do not have one yet, you may" | |
echo "cancel this setup, press Ctrl+C. This script will run again on your next login" | |
echo "--------------------------------------------------" | |
echo "Enter the domain name for your new WordPress site." | |
echo "(ex. example.org or test.example.org) do not include www or http/s" | |
echo "--------------------------------------------------" |