Skip to content

Instantly share code, notes, and snippets.

View ankitdubey021's full-sized avatar

Ankit Dubey ankitdubey021

View GitHub Profile
@ExperimentalAnimationApi
@ExperimentalMaterialApi
@Composable
fun MyExpandedList() {
var expanded by remember { mutableStateOf(false) }
val rotateState = animateFloatAsState(
targetValue = if (expanded) 180F else 0F,
)
@ankitdubey021
ankitdubey021 / AddPolylinesToMap.java
Created January 17, 2020 12:18 — forked from mitchtabian/AddPolylinesToMap.java
Clicking and Highlighting Polylines
private void addPolylinesToMap(final DirectionsResult result){
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
Log.d(TAG, "run: result routes: " + result.routes.length);
if(mPolyLinesData.size() > 0){
for(PolylineData polylineData: mPolyLinesData){
polylineData.getPolyline().remove();
}
mPolyLinesData.clear();
package dao;
import java.util.Date;
import androidx.room.TypeConverter;
public class DateConverter {
@TypeConverter
public static Date toDate(Long timestamp){
if(timestamp!=null){
package dao;
import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
@Database(entities = {Student.class},version = 1, exportSchema = false)
public abstract class AppDatabase extends RoomDatabase {
package dao;
import java.util.List;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
package dao;
import java.util.Date;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
@Entity(tableName = "student_master")
public class Student{
@PrimaryKey(autoGenerate = true)
private int sno;
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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">
<ImageView
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.media.AudioAttributes;
import android.util.Log;
import com.ebiztechnocrats.biofuelindia.OldQuotation;
import com.ebiztechnocrats.biofuelindia.R;
import com.ebiztechnocrats.biofuelindia.ViewResponses;
bar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),"Home Clicked",Toast.LENGTH_LONG).show();
}
});
bar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:background="@color/gray"
android:layout_height="match_parent">
<!-- Other components and views -->