This file contains 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
import android.content.Context | |
import android.net.ConnectivityManager | |
import android.net.Network | |
import android.net.NetworkCapabilities | |
import android.net.NetworkRequest | |
import android.os.Bundle | |
import android.widget.TextView | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelProvider |
This file contains 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
<activity android:launchMode="singleInstance"/> |
This file contains 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
<activity android:launchMode="singleTask"/> |
This file contains 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
<activity android:launchMode="singleTop"/> |
This file contains 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
<activity android:launchMode="standard"/> |
This file contains 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
package `in`.gsrathoreniks.validationdemo | |
import androidx.appcompat.widget.AppCompatEditText | |
import java.util.regex.Pattern | |
object ValidationUtil { | |
fun isValidUsername(view: AppCompatEditText, username: String?, regex: String = "^[a-zA-Z0-9._-]{3,20}$"): Boolean { | |
view.requestFocus() | |
when { |
This file contains 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
package `in`.gsrathoreniks.validationdemo | |
import android.annotation.SuppressLint | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.view.View | |
import com.google.android.material.button.MaterialButton | |
import com.google.android.material.textfield.TextInputEditText | |
class MainActivity : AppCompatActivity() { |
This file contains 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
private var _binding: FragmentProfileBinding? = null | |
// This property is only valid between onCreateView and | |
// onDestroyView. | |
private val binding get() = _binding!! | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { |
This file contains 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
private lateinit var binding: ActivityProfileBinding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
//initializing binding | |
binding = ActivityProfileBinding.inflate(layoutInflater) | |
val view = binding.root | |
setContentView(view) | |
} |
This file contains 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
<LinearLayout ... > | |
<ImageView android:cropToPadding="true" /> | |
<TextView android:id="@+id/tvName" /> | |
<Button android:id="@+id/nextBtn" | |
android:background="@drawable/rounded_button" /> | |
</LinearLayout> |
NewerOlder