Skip to content

Instantly share code, notes, and snippets.

View gsrathoreniks's full-sized avatar
🖥️
Building solutions

Gajendra Singh Rathore gsrathoreniks

🖥️
Building solutions
View GitHub Profile
@gsrathoreniks
gsrathoreniks / activity_profile.xml
Created October 28, 2020 10:16
A basic layout file
<LinearLayout ... >
<ImageView android:cropToPadding="true" />
<TextView android:id="@+id/tvName" />
<Button android:id="@+id/nextBtn"
android:background="@drawable/rounded_button" />
</LinearLayout>
@gsrathoreniks
gsrathoreniks / activity_main.xml
Created October 28, 2020 08:22
Ignore View Binding for a particular layout.
<LinearLayout
...
tools:viewBindingIgnore="true" >
...
</LinearLayout>
@gsrathoreniks
gsrathoreniks / build.gradle
Created October 28, 2020 08:20
Enable ViewBinding in module-level gradle
android {
...
buildFeatures {
viewBinding true
}
}
@gsrathoreniks
gsrathoreniks / AndroidManifest.xml
Created October 27, 2020 07:34
Put Application Class in Android Manifest
<application
android:name=".MyApplication"
android:icon="@drawable/icon"
android:label="@string/app_name"
...>
@gsrathoreniks
gsrathoreniks / MyApplication.kt
Created October 27, 2020 07:28
Android Application Class in Kotlin
class MyApplication : Application(){
//Optional override
override fun onCreate() {
super.onCreate()
// Write initialization logic here!
}
}
@gsrathoreniks
gsrathoreniks / MyApplication.java
Last active October 27, 2020 07:28
application_class.java
public class MyApplication extends Application {
//Optional override
@Override
public void onCreate() {
super.onCreate();
// Write initialization logic here!
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.airbnb.lottie.LottieAnimationView
dependencies {
// Replace lottieVersion with the latest version available
implementation 'com.airbnb.android:lottie:$lottieVersion'
}
GOTO---> searchFragment----> onBindViewHolder
//-------------------------------------------------------------------------------------
@Override
protected void onBindViewHolder(@NonNull final UsersViewHolder holder, final int position, @NonNull final SearchItem model) {
holder.setDetails(getActivity(), model.getName(), model.getUsername(), model.getProfile_pic());
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
1. Add this to STYLE.XML
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/launch</item>
</style>
__________________________________________________________________________
2. Add launch.xml file in {res --> drawable}