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
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="355dp"
android:height="320dp"
android:viewportWidth="355"
android:viewportHeight="320">
<group
android:name="Page-1">
<path
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.GradientDrawable;
import android.net.Uri;
import android.os.Build;
import android.support.design.widget.Snackbar;
open class BitmapUtils {
var _view: View? = null
var _context: Context? = null
constructor(context: Context, view: View) {
this._view = view
this._context = context
}
fun convertLayout(): Bitmap {
@gsrathoreniks
gsrathoreniks / Quit_app
Created July 13, 2018 09:10
To quit an Android app completely
if(Build.VERSION.SDK_INT>=16 && Build.VERSION.SDK_INT<21){
finishAffinity();
} else if(Build.VERSION.SDK_INT>=21){
finishAndRemoveTask();
}
BitMap bitmap = .......
------------------------------
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.putExtra(Intent.EXTRA_STREAM, getImageUri(getApplicationContext(),bitmap));
sharingIntent.setType("image/jpeg");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "HEADING");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "SOME TEXT TO SHARE WITH IMAGE");
startActivity(Intent.createChooser(sharingIntent, "Share via"));
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_login);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
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}
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
dependencies {
// Replace lottieVersion with the latest version available
implementation 'com.airbnb.android:lottie:$lottieVersion'
}
<?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