Skip to content

Instantly share code, notes, and snippets.

Ankit Dubey ankitdubey021

View GitHub Profile
@ankitdubey021
ankitdubey021 / AddPolylinesToMap.java
Created Jan 17, 2020 — forked from mitchtabian/AddPolylinesToMap.java
Clicking and Highlighting Polylines
View AddPolylinesToMap.java
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();
View DateConverter.java
package dao;
import java.util.Date;
import androidx.room.TypeConverter;
public class DateConverter {
@TypeConverter
public static Date toDate(Long timestamp){
if(timestamp!=null){
View AppDatabase.java
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 {
View StudentDAO.java
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;
View Student.java
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;
View uber_layout.xml
<?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
View MyFirebaseService.java
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;
View option_click.xml
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) {
View bottom_app_bar.xml
<?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 -->
You can’t perform that action at this time.