This file contains 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.support.design.widget.CollapsingToolbarLayout | |
android:id="@+id/toolbar_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true" | |
app:contentScrim="?attr/colorPrimary" | |
app:layout_scrollFlags="scroll|exitUntilCollapsed" | |
app:toolbarId="@+id/toolbar"> | |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout 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" | |
android:fitsSystemWindows="true" | |
tools:context=".CollapseActivity"> | |
<android.support.design.widget.AppBarLayout |
This file contains 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 ExamplePermissionActivity extends AppCompatActivity{ | |
private final static int MY_PERMISSIONS_REQUEST_CAMERA = 100; | |
... | |
public void cliqueNoBotaoCameraPorExemplo(View view){ | |
//Checa se a versao do Android do usuario eh maior ou igual ao Android 6 . | |
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { |
This file contains 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
Process: br.com.packapps.bpdrive, PID: 29102 java.lang.IllegalStateException: Required DataBindingComponent is null in | |
class FragmentDetailsBinding. A BindingAdapter in br.com.packapps.bpdrive.viewmodel.CarSelectedViewModel.Companion is | |
not static and requires an object to use, retrieved from the DataBindingComponent. If you don't use an inflation method | |
taking a DataBindingComponent, use DataBindingUtil.setDefaultComponent or make all BindingAdapter methods static. at | |
android.databinding.ViewDataBinding.ensureBindingComponentIsNotNull(ViewDataBinding.java:554) |
This file contains 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 void openNavigationMap(Location currentLocation, Marker currentMarker){ | |
String uri = "http://maps.google.com/maps?f=d&hl=en&saddr=" | |
+ currentMarker.getPosition().latitude+","+currentMarker.getPosition().longitude | |
+"&daddr=" + currentLocation.getLatitude() + "," + currentLocation.getLongitude(); | |
Uri gmmIntentUri = Uri.parse(uri); | |
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri); | |
startActivity(mapIntent); | |
} |
This file contains 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 fun setLocationInDatabase(key : String) { | |
geofire!!.setLocation(key, GeoLocation(-1.3904518, -48.4673762), GeoFire.CompletionListener { key, error -> | |
if (error == null) { | |
Log.i("TAG", "geo added successful: " + key) | |
//Save detail | |
val moreDataProvider: HashMap<String, Any> = hashMapOf("car" to "Honda Fit", "color" to "grey", "is_available" to 0) | |
db!!.child("details").child(key).setValue(moreDataProvider) | |
}else { |
This file contains 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 MainActivity : AppCompatActivity() { | |
var db : DatabaseReference? = null | |
var geofire : GeoFire? = null | |
var timeMillisId : Long = 0 | |
override fun onCreate(savedInstanceState: Bundle?) { | |
... |
This file contains 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 MainActivity : AppCompatActivity() { | |
var timeMillisId : Long = 0 | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val db : DatabaseReference = FirebaseDatabase.getInstance().getReference("geo/providers") | |
val geofire = GeoFire(db) |
This file contains 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
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
android { | |
compileSdkVersion 26 | |
buildToolsVersion "26.0.2" | |
defaultConfig { | |
applicationId "br.com.packapps.geofireapplication" | |
minSdkVersion 16 |