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
public class MyApplication extends Application { | |
//Optional override | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
// Write initialization logic here! | |
} | |
} |
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 MyApplication : Application(){ | |
//Optional override | |
override fun onCreate() { | |
super.onCreate() | |
// Write initialization logic here! | |
} | |
} |
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
<application | |
android:name=".MyApplication" | |
android:icon="@drawable/icon" | |
android:label="@string/app_name" | |
...> |
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
android { | |
... | |
buildFeatures { | |
viewBinding true | |
} | |
} |
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
<LinearLayout | |
... | |
tools:viewBindingIgnore="true" > | |
... | |
</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
<LinearLayout ... > | |
<ImageView android:cropToPadding="true" /> | |
<TextView android:id="@+id/tvName" /> | |
<Button android:id="@+id/nextBtn" | |
android:background="@drawable/rounded_button" /> | |
</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
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 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
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 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
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 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
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 { |