This file contains hidden or 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 { | |
..... | |
flavorDimensions "appType" //Can be anything, just identifier | |
productFlavors { | |
Client { | |
dimension "appType" | |
applicationIdSuffix ".client" //Will be added to package name of the app, making the app unique | |
//More can be added like |
This file contains hidden or 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 ProductLoadingStateAdapter : | |
LoadStateAdapter<ProductLoadingStateAdapter.LoadStateViewHolder>() { | |
override fun onBindViewHolder(holder: LoadStateViewHolder, loadState: LoadState) { | |
val progress = holder.itemView.progress_bar_item | |
val txtErrorMessage = holder.itemView.error_msg_item | |
This file contains hidden or 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 isInternetAvailable(context: Context): Boolean { | |
var result = false | |
val connectivityManager = | |
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
val networkCapabilities = connectivityManager.activeNetwork ?: return false | |
val actNw = | |
connectivityManager.getNetworkCapabilities(networkCapabilities) ?: return false | |
result = when { | |
actNw.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true |
This file contains hidden or 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 class ListActivity extends AppCompatActivity implements RecyclerViewAdapter.OnItemClickListener { | |
private RecyclerViewAdapter recyclerViewAdapter; | |
private FirebaseFirestore db = FirebaseFirestore.getInstance(); | |
private Context context; | |
private TravelDeal clickedItem; | |
private FirestoreRecyclerOptions<TravelDeal> options; | |
private CollectionReference dbRef; | |
private FirebaseAuth mAuth = FirebaseAuth.getInstance(); | |
private FirebaseUser user = mAuth.getCurrentUser(); | |
private MenuItem next; |
This file contains hidden or 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
package com.example.retrofitpractice; | |
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.TextView; |
This file contains hidden or 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
package com.example.travelmantics; | |
import android.content.Intent; | |
import android.content.res.Resources; | |
import android.net.Uri; | |
//import android.support.annotation.NonNull; | |
//mport android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.Menu; |
This file contains hidden or 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 void signIn() { | |
List<AuthUI.IdpConfig> providers = Arrays.asList( | |
new AuthUI.IdpConfig.EmailBuilder().build(), | |
new AuthUI.IdpConfig.GoogleBuilder().build()); | |
startActivityForResult( | |
AuthUI.getInstance() | |
.createSignInIntentBuilder() | |
.setAvailableProviders(providers) |
This file contains hidden or 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 void signIn() { | |
List<AuthUI.IdpConfig> providers = Arrays.asList( | |
new AuthUI.IdpConfig.EmailBuilder().build(), | |
new AuthUI.IdpConfig.GoogleBuilder().build()); | |
startActivityForResult( | |
AuthUI.getInstance() | |
.createSignInIntentBuilder() | |
.setAvailableProviders(providers) |
This file contains hidden or 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
package com.example.travelmantics; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.provider.MediaStore; |
This file contains hidden or 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 class ProfileActivity extends Fragment { | |
private static final int CHOOSE_IMAGE = 101; | |
Context context; | |
ImageView imageView; | |
EditText editTextName, editTextEmail, editTextPhone, editTextAddress, editTextCity; | |
Button update; | |
private static final String KEY_EMAIL = "email"; | |
private static final String KEY_NUMBER = "number"; | |
private static final String KEY_ADDRESS = "address"; |
NewerOlder