From ab3ae49917802faf908e27992d650ca1f3183139 Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Mon, 10 Sep 2018 14:39:25 -0700 Subject: [PATCH 1/8] master --- app/google-services.json | 42 ---------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 app/google-services.json diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 703cf21..0000000 --- a/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "508128212987", - "firebase_url": "https://maps-2018-326a4.firebaseio.com", - "project_id": "maps-2018-326a4", - "storage_bucket": "maps-2018-326a4.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:508128212987:android:a1d1ce9b8c3681aa", - "android_client_info": { - "package_name": "com.codingwithmitch.googlemaps2018" - } - }, - "oauth_client": [ - { - "client_id": "508128212987-qbtqiouctsvvbl7picsnn3adgdold6b4.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCRgxWHg6lfsGPgJFTiyBI1jCBgFWC3J2A" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file From ef2013fb67e911d9cbfdc54730ee734d7e27725f Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Mon, 10 Sep 2018 15:16:22 -0700 Subject: [PATCH 2/8] master --- .idea/vcs.xml | 6 + app/build.gradle | 7 + app/google-services.json | 42 ++++++ app/src/main/AndroidManifest.xml | 1 + .../adapters/ImageListRecyclerAdapter.java | 78 +++++++++++ .../googlemaps2018/models/User.java | 22 +++- .../googlemaps2018/ui/ChatroomActivity.java | 22 ++-- .../googlemaps2018/ui/IProfile.java | 6 + .../googlemaps2018/ui/ImageListFragment.java | 95 ++++++++++++++ .../googlemaps2018/ui/MainActivity.java | 55 +------- .../googlemaps2018/ui/ProfileActivity.java | 123 ++++++++++++++++++ app/src/main/res/layout/activity_profile.xml | 43 ++++++ .../main/res/layout/fragment_image_list.xml | 17 +++ .../res/layout/layout_image_list_item.xml | 11 ++ app/src/main/res/menu/menu_main.xml | 4 + app/src/main/res/values/strings.xml | 10 ++ 16 files changed, 478 insertions(+), 64 deletions(-) create mode 100644 .idea/vcs.xml create mode 100644 app/google-services.json create mode 100644 app/src/main/java/com/codingwithmitch/googlemaps2018/adapters/ImageListRecyclerAdapter.java create mode 100644 app/src/main/java/com/codingwithmitch/googlemaps2018/ui/IProfile.java create mode 100644 app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ImageListFragment.java create mode 100644 app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ProfileActivity.java create mode 100644 app/src/main/res/layout/activity_profile.xml create mode 100644 app/src/main/res/layout/fragment_image_list.xml create mode 100644 app/src/main/res/layout/layout_image_list_item.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 733d4ad..fb0608a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,5 +38,12 @@ dependencies { implementation 'com.google.firebase:firebase-auth:16.0.2' // Firestore Firestore implementation 'com.google.firebase:firebase-firestore:17.0.4' + + // glide + implementation 'com.github.bumptech.glide:glide:4.8.0' + annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0' + + // Circle ImageView + implementation 'de.hdodenhof:circleimageview:2.2.0' } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..703cf21 --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,42 @@ +{ + "project_info": { + "project_number": "508128212987", + "firebase_url": "https://maps-2018-326a4.firebaseio.com", + "project_id": "maps-2018-326a4", + "storage_bucket": "maps-2018-326a4.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:508128212987:android:a1d1ce9b8c3681aa", + "android_client_info": { + "package_name": "com.codingwithmitch.googlemaps2018" + } + }, + "oauth_client": [ + { + "client_id": "508128212987-qbtqiouctsvvbl7picsnn3adgdold6b4.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCRgxWHg6lfsGPgJFTiyBI1jCBgFWC3J2A" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c0c24ae..2063a53 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,6 +22,7 @@ + diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/adapters/ImageListRecyclerAdapter.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/adapters/ImageListRecyclerAdapter.java new file mode 100644 index 0000000..0906733 --- /dev/null +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/adapters/ImageListRecyclerAdapter.java @@ -0,0 +1,78 @@ +package com.codingwithmitch.googlemaps2018.adapters; + +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.ImageView; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.codingwithmitch.googlemaps2018.R; + + +import java.util.ArrayList; + +public class ImageListRecyclerAdapter extends RecyclerView.Adapter{ + + private ArrayList mImages = new ArrayList<>(); + private ImageListRecyclerClickListener mImageListRecyclerClickListener; + private Context mContext; + + public ImageListRecyclerAdapter(Context context, ArrayList images, ImageListRecyclerClickListener imageListRecyclerClickListener) { + mContext = context; + mImages = images; + mImageListRecyclerClickListener = imageListRecyclerClickListener; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_image_list_item, parent, false); + final ViewHolder holder = new ViewHolder(view, mImageListRecyclerClickListener); + return holder; + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + + RequestOptions requestOptions = new RequestOptions() + .placeholder(R.drawable.cwm_logo) + .error(R.drawable.cwm_logo); + + Glide.with(mContext) + .setDefaultRequestOptions(requestOptions) + .load(mImages.get(position)) + .into(((ViewHolder)holder).image); + } + + @Override + public int getItemCount() { + return mImages.size(); + } + + public class ViewHolder extends RecyclerView.ViewHolder implements + View.OnClickListener + { + ImageView image; + ImageListRecyclerClickListener mClickListener; + + public ViewHolder(View itemView, ImageListRecyclerClickListener clickListener) { + super(itemView); + image = itemView.findViewById(R.id.image); + mClickListener = clickListener; + itemView.setOnClickListener(this); + } + + @Override + public void onClick(View v) { + mClickListener.onImageSelected(getAdapterPosition()); + } + } + + public interface ImageListRecyclerClickListener{ + void onImageSelected(int position); + } +} diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/models/User.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/models/User.java index ab2b825..93223c6 100644 --- a/app/src/main/java/com/codingwithmitch/googlemaps2018/models/User.java +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/models/User.java @@ -3,16 +3,18 @@ import android.os.Parcel; import android.os.Parcelable; -public class User implements Parcelable { +public class User implements Parcelable{ private String email; private String user_id; private String username; + private String avatar; - public User(String email, String user_id, String username) { + public User(String email, String user_id, String username, String avatar) { this.email = email; this.user_id = user_id; this.username = username; + this.avatar = avatar; } public User() { @@ -23,6 +25,7 @@ protected User(Parcel in) { email = in.readString(); user_id = in.readString(); username = in.readString(); + avatar = in.readString(); } public static final Creator CREATOR = new Creator() { @@ -37,6 +40,18 @@ public User[] newArray(int size) { } }; + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public static Creator getCREATOR() { + return CREATOR; + } + public String getEmail() { return email; } @@ -67,6 +82,7 @@ public String toString() { "email='" + email + '\'' + ", user_id='" + user_id + '\'' + ", username='" + username + '\'' + + ", avatar='" + avatar + '\'' + '}'; } @@ -80,5 +96,7 @@ public void writeToParcel(Parcel dest, int flags) { dest.writeString(email); dest.writeString(user_id); dest.writeString(username); + dest.writeString(avatar); } } + diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java index 7a38b62..ab2bca0 100644 --- a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java @@ -209,17 +209,14 @@ private void clearMessage(){ } private void inflateUserListFragment(){ - if(mUserListFragment == null){ - mUserListFragment = UserListFragment.newInstance(); - } - + UserListFragment fragment = UserListFragment.newInstance(); Bundle bundle = new Bundle(); bundle.putParcelableArrayList(getString(R.string.intent_user_list), mUserList); - mUserListFragment.setArguments(bundle); + fragment.setArguments(bundle); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.setCustomAnimations(R.anim.slide_in_up, R.anim.slide_out_up); - transaction.replace(R.id.user_list_container, mUserListFragment, getString(R.string.fragment_user_list)); + transaction.replace(R.id.user_list_container, fragment, getString(R.string.fragment_user_list)); transaction.addToBackStack(getString(R.string.fragment_user_list)); transaction.commit(); } @@ -289,12 +286,15 @@ public boolean onCreateOptionsMenu(Menu menu) { public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()){ case android.R.id.home:{ - if(mUserListFragment.isVisible()){ - getSupportFragmentManager().popBackStack(); - } - else{ - finish(); + UserListFragment fragment = + (UserListFragment) getSupportFragmentManager().findFragmentByTag(getString(R.string.fragment_user_list)); + if(fragment != null){ + if(fragment.isVisible()){ + getSupportFragmentManager().popBackStack(); + return true; + } } + finish(); return true; } case R.id.action_chatroom_user_list:{ diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/IProfile.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/IProfile.java new file mode 100644 index 0000000..bb694f7 --- /dev/null +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/IProfile.java @@ -0,0 +1,6 @@ +package com.codingwithmitch.googlemaps2018.ui; + +public interface IProfile { + + void onImageSelected(int resource); +} diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ImageListFragment.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ImageListFragment.java new file mode 100644 index 0000000..ba5b256 --- /dev/null +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ImageListFragment.java @@ -0,0 +1,95 @@ +package com.codingwithmitch.googlemaps2018.ui; + + +import android.content.Context; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.StaggeredGridLayoutManager; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +import com.codingwithmitch.googlemaps2018.R; +import com.codingwithmitch.googlemaps2018.adapters.ImageListRecyclerAdapter; + +import java.util.ArrayList; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link ImageListFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class ImageListFragment extends Fragment implements ImageListRecyclerAdapter.ImageListRecyclerClickListener{ + + private static final String TAG = "ImageListFragment"; + private static final int NUM_COLUMNS = 2; + + //widgets + private RecyclerView mRecyclerView; + + + //vars + private ArrayList mImageResources = new ArrayList<>(); + private IProfile mIProfile; + + public ImageListFragment() { + // Required empty public constructor + } + + + public static ImageListFragment newInstance() { + return new ImageListFragment(); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_image_list, container, false); + mRecyclerView = view.findViewById(R.id.image_list_recyclerview); + + getImageResouces(); + initRecyclerview(); + + return view; + } + + private void getImageResouces(){ + mImageResources.add(R.drawable.cwm_logo); + mImageResources.add(R.drawable.cartman_cop); + mImageResources.add(R.drawable.eric_cartman); + mImageResources.add(R.drawable.ike); + mImageResources.add(R.drawable.kyle); + mImageResources.add(R.drawable.satan); + mImageResources.add(R.drawable.chef); + mImageResources.add(R.drawable.tweek); + } + + private void initRecyclerview(){ + ImageListRecyclerAdapter mAdapter = new ImageListRecyclerAdapter(getActivity(), mImageResources, this); + StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(NUM_COLUMNS, LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(staggeredGridLayoutManager); + mRecyclerView.setAdapter(mAdapter); + } + + @Override + public void onAttach(Context context) { + super.onAttach(context); + mIProfile = (IProfile) getActivity(); + } + + @Override + public void onImageSelected(int position) { + mIProfile.onImageSelected(mImageResources.get(position)); + } +} + + + + + + + + diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/MainActivity.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/MainActivity.java index 7e9a9e1..904dfb1 100644 --- a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/MainActivity.java +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/MainActivity.java @@ -61,7 +61,6 @@ public class MainActivity extends AppCompatActivity implements //vars private ArrayList mChatrooms = new ArrayList<>(); private Set mChatroomIds = new HashSet<>(); -// private Set mChatrooms = new HashSet<>(); private ChatroomRecyclerAdapter mChatroomRecyclerAdapter; private RecyclerView mChatroomRecyclerView; private ListenerRegistration mChatroomEventListener; @@ -87,55 +86,6 @@ private void initSupportActionBar(){ } - public boolean isMapsEnabled(){ - final LocationManager manager = (LocationManager) getSystemService( Context.LOCATION_SERVICE ); - - if ( !manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) ) { - buildAlertMessageNoGps(); - return false; - } - return true; - } - - private void buildAlertMessageNoGps() { - final AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage("Your GPS seems to be disabled, do you want to enable it?") - .setCancelable(false) - .setPositiveButton("Yes", new DialogInterface.OnClickListener() { - public void onClick(@SuppressWarnings("unused") final DialogInterface dialog, @SuppressWarnings("unused") final int id) { - startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS)); - } - }) - .setNegativeButton("No", new DialogInterface.OnClickListener() { - public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) { - dialog.cancel(); - } - }); - final AlertDialog alert = builder.create(); - alert.show(); - } - - public boolean isServicesOK(){ - Log.d(TAG, "isServicesOK: checking google services version"); - - int available = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(MainActivity.this); - - if(available == ConnectionResult.SUCCESS){ - //everything is fine and the user can make map requests - Log.d(TAG, "isServicesOK: Google Play Services is working"); - return true; - } - else if(GoogleApiAvailability.getInstance().isUserResolvableError(available)){ - //an error occured but we can resolve it - Log.d(TAG, "isServicesOK: an error occured but we can fix it"); - Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(MainActivity.this, available, ERROR_DIALOG_REQUEST); - dialog.show(); - }else{ - Toast.makeText(this, "You can't make map requests", Toast.LENGTH_SHORT).show(); - } - return false; - } - @Override public void onClick(View view) { switch (view.getId()){ @@ -273,7 +223,6 @@ protected void onResume() { @Override public void onChatroomSelected(int position) { navChatroomActivity(mChatrooms.get(position)); -// navChatroomActivity( ((Chatroom)(mChatrooms.toArray()[position]))); } private void signOut(){ @@ -298,6 +247,10 @@ public boolean onOptionsItemSelected(MenuItem item) { signOut(); return true; } + case R.id.action_profile:{ + startActivity(new Intent(this, ProfileActivity.class)); + return true; + } default:{ return super.onOptionsItemSelected(item); } diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ProfileActivity.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ProfileActivity.java new file mode 100644 index 0000000..0db87f8 --- /dev/null +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ProfileActivity.java @@ -0,0 +1,123 @@ +package com.codingwithmitch.googlemaps2018.ui; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; + + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.codingwithmitch.googlemaps2018.R; +import com.codingwithmitch.googlemaps2018.UserClient; +import com.codingwithmitch.googlemaps2018.models.User; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.firestore.FirebaseFirestore; + +import de.hdodenhof.circleimageview.CircleImageView; + + +public class ProfileActivity extends AppCompatActivity implements + View.OnClickListener, + IProfile +{ + + private static final String TAG = "ProfileActivity"; + + + //widgets + private CircleImageView mAvatarImage; + + //vars + private ImageListFragment mImageListFragment; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_profile); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setHomeButtonEnabled(true); + mAvatarImage = findViewById(R.id.image_choose_avatar); + + findViewById(R.id.image_choose_avatar).setOnClickListener(this); + findViewById(R.id.text_choose_avatar).setOnClickListener(this); + + retrieveProfileImage(); + } + + private void retrieveProfileImage(){ + RequestOptions requestOptions = new RequestOptions() + .error(R.drawable.cwm_logo) + .placeholder(R.drawable.cwm_logo); + + int avatar = 0; + try{ + avatar = Integer.parseInt(((UserClient)getApplicationContext()).getUser().getAvatar()); + }catch (NumberFormatException e){ + Log.e(TAG, "retrieveProfileImage: no avatar image. Setting default. " + e.getMessage() ); + } + + Glide.with(ProfileActivity.this) + .setDefaultRequestOptions(requestOptions) + .load(avatar) + .into(mAvatarImage); + } + + @Override + public void onClick(View v) { + mImageListFragment = new ImageListFragment(); + getSupportFragmentManager().beginTransaction() + .setCustomAnimations(R.anim.slide_in_up, R.anim.slide_in_down, R.anim.slide_out_down, R.anim.slide_out_up) + .replace(R.id.fragment_container, mImageListFragment, getString(R.string.fragment_image_list)) + .commit(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + + switch (item.getItemId()){ + case android.R.id.home:{ + finish(); + } + } + return super.onOptionsItemSelected(item); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + return super.onCreateOptionsMenu(menu); + } + + @Override + public void onImageSelected(int resource) { + + // remove the image selector fragment + getSupportFragmentManager().beginTransaction() + .setCustomAnimations(R.anim.slide_in_up, R.anim.slide_in_down, R.anim.slide_out_down, R.anim.slide_out_up) + .remove(mImageListFragment) + .commit(); + + // display the image + RequestOptions requestOptions = new RequestOptions() + .placeholder(R.drawable.cwm_logo) + .error(R.drawable.cwm_logo); + + Glide.with(this) + .setDefaultRequestOptions(requestOptions) + .load(resource) + .into(mAvatarImage); + + // update the client and database + User user = ((UserClient)getApplicationContext()).getUser(); + user.setAvatar(String.valueOf(resource)); + + FirebaseFirestore.getInstance() + .collection(getString(R.string.collection_users)) + .document(FirebaseAuth.getInstance().getUid()) + .set(user); + } + +} diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml new file mode 100644 index 0000000..d0ead8c --- /dev/null +++ b/app/src/main/res/layout/activity_profile.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_image_list.xml b/app/src/main/res/layout/fragment_image_list.xml new file mode 100644 index 0000000..d768e65 --- /dev/null +++ b/app/src/main/res/layout/fragment_image_list.xml @@ -0,0 +1,17 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_image_list_item.xml b/app/src/main/res/layout/layout_image_list_item.xml new file mode 100644 index 0000000..516d9c3 --- /dev/null +++ b/app/src/main/res/layout/layout_image_list_item.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 4a5acca..84727f6 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -2,6 +2,10 @@ + Chatrooms Chat Messages User List + User Locations intent_chatroom intent_user_list + intent_user_locations + intent_location + + + gps_location + User List + Image List Create Chatroom Leave chatroom User list + Profile + From 1f6f03c9978fbc7c3a17d1da45aa2062ba5654d1 Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Mon, 10 Sep 2018 15:16:33 -0700 Subject: [PATCH 3/8] master --- app/google-services.json | 42 ---------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 app/google-services.json diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 703cf21..0000000 --- a/app/google-services.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "project_info": { - "project_number": "508128212987", - "firebase_url": "https://maps-2018-326a4.firebaseio.com", - "project_id": "maps-2018-326a4", - "storage_bucket": "maps-2018-326a4.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:508128212987:android:a1d1ce9b8c3681aa", - "android_client_info": { - "package_name": "com.codingwithmitch.googlemaps2018" - } - }, - "oauth_client": [ - { - "client_id": "508128212987-qbtqiouctsvvbl7picsnn3adgdold6b4.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCRgxWHg6lfsGPgJFTiyBI1jCBgFWC3J2A" - } - ], - "services": { - "analytics_service": { - "status": 1 - }, - "appinvite_service": { - "status": 1, - "other_platform_oauth_client": [] - }, - "ads_service": { - "status": 2 - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file From 03a68aaf3b4364517b72edde88324f5754bc9ccb Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Fri, 14 Sep 2018 09:02:17 -0700 Subject: [PATCH 4/8] Update .gitignore --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5edb4ee..3f4fefd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ *.iml .gradle /local.properties -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml +.idea/ .DS_Store /build /captures From b89fddde62a1648e75d08180bd374bf8eaea5a64 Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Mon, 17 Sep 2018 18:13:45 -0700 Subject: [PATCH 5/8] master --- .../codingwithmitch/googlemaps2018/ui/ChatroomActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java index ab2bca0..b7deaf5 100644 --- a/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java +++ b/app/src/main/java/com/codingwithmitch/googlemaps2018/ui/ChatroomActivity.java @@ -209,6 +209,8 @@ private void clearMessage(){ } private void inflateUserListFragment(){ + hideSoftKeyboard(); + UserListFragment fragment = UserListFragment.newInstance(); Bundle bundle = new Bundle(); bundle.putParcelableArrayList(getString(R.string.intent_user_list), mUserList); @@ -221,6 +223,10 @@ private void inflateUserListFragment(){ transaction.commit(); } + private void hideSoftKeyboard(){ + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); + } + private void getIncomingIntent(){ if(getIntent().hasExtra(getString(R.string.intent_chatroom))){ From 4e29cbf61442c88ebbbb72129a5da24b1c3ff72f Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Wed, 19 Sep 2018 19:52:54 -0700 Subject: [PATCH 6/8] Create README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bea7f00 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ + + +

Google Maps and Directions API

+

Watch the course on YouTube: here.

+

Watch the Course Demo.

+ +

What you'll learn:

+
    +
  1. Enabling the Google Maps SDK for Android
  2. +
  3. Ebaling the Google Directions API for Android
  4. +
  5. MapView objects
  6. +
  7. Animating and moving the camera view
  8. +
  9. Setting view bounds on a google map
  10. +
  11. Building a thread that retrieves coordinates a database
  12. +
  13. Building a service that inserts coordinates into a database
  14. +
  15. Create custom map markers with images
  16. +
  17. Get real time gps updates of users (Like Uber does)
  18. +
  19. How to use marker cluster to make custom map markers
  20. +
  21. Retrieving distance and travel time information using the directions API
  22. +
  23. Adding Polylines to a google map
  24. +
  25. Determining the fastest route
  26. +
  27. Opening the Google Maps application using an intent and uri
  28. +
+ + + From 0b57a83d8df2c46d6c57c5ac96795510ec5d18d9 Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Wed, 19 Sep 2018 19:53:35 -0700 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bea7f00..3498069 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@

What you'll learn:

  1. Enabling the Google Maps SDK for Android
  2. -
  3. Ebaling the Google Directions API for Android
  4. +
  5. Enabling the Google Directions API for Android
  6. MapView objects
  7. Animating and moving the camera view
  8. Setting view bounds on a google map
  9. From 0d21b7469bd28df9583da812c3a431003f271702 Mon Sep 17 00:00:00 2001 From: Mitch Tabian Date: Wed, 19 Sep 2018 20:03:00 -0700 Subject: [PATCH 8/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3498069..9a83916 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@
  10. MapView objects
  11. Animating and moving the camera view
  12. Setting view bounds on a google map
  13. -
  14. Building a thread that retrieves coordinates a database
  15. +
  16. Building a thread that retrieves coordinates from a database
  17. Building a service that inserts coordinates into a database
  18. Create custom map markers with images
  19. Get real time gps updates of users (Like Uber does)