Skip to content

Commit

Permalink
Updated libraries, removed Trianglify.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrenderG committed Mar 29, 2017
1 parent a0b7aab commit e62d175
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 432 deletions.
19 changes: 9 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.appmatic.baseapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 922
versionName "0.9.2.2"
versionCode 923
versionName "0.9.2.3"
}

buildTypes {
Expand All @@ -23,21 +23,20 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-v13:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.GrenderG:Prefs:1.2'
compile 'com.github.GrenderG:Prefs:1.3'
compile 'com.jakewharton:process-phoenix:1.1.0'
compile 'com.manolovn:trianglify:1.1.0'
compile 'com.afollestad.material-dialogs:core:0.9.3.0'
compile 'com.afollestad.material-dialogs:core:0.9.4.2'
compile 'com.pixplicity.htmlcompat:library:1.0.0'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
Expand Down
40 changes: 18 additions & 22 deletions app/src/main/java/com/appmatic/baseapp/contact/ContactFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.appmatic.baseapp.R;
import com.appmatic.baseapp.api.models.Contact;
import com.appmatic.baseapp.contact.trianglify.ContactColorGenerator;
import com.appmatic.baseapp.fragments.BaseFragment;
import com.appmatic.baseapp.main.MainActivity;
import com.appmatic.baseapp.utils.AppmaticUtils;
Expand All @@ -35,8 +34,6 @@
import com.google.android.gms.maps.model.CameraPosition;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.manolovn.trianglify.TrianglifyView;
import com.manolovn.trianglify.generator.point.RegularPointGenerator;

import butterknife.BindView;

Expand Down Expand Up @@ -68,8 +65,8 @@ public class ContactFragment extends BaseFragment implements OnMapReadyCallback,
FloatingActionButton fabFullscreenMap;
@BindView(R.id.map_view)
MapView mapView;
@BindView(R.id.contact_trianglify_view)
TrianglifyView contactTrianglifyView;
@BindView(R.id.contact_placeholder_image)
ImageView contactPlaceholderImage;
@BindView(R.id.contact_name_layout)
LinearLayout contactNameLayout;
@BindView(R.id.contact_phone_layout)
Expand Down Expand Up @@ -112,13 +109,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
final View view = super.onCreateView(inflater, container, savedInstanceState, R.layout.fragment_contact);
final Bundle mapViewSavedInstanceState =
savedInstanceState != null ? savedInstanceState.getBundle(MAP_VIEW_SAVE_STATE) : null;
this.mapView.onCreate(mapViewSavedInstanceState);
if (mapView != null)
this.mapView.onCreate(mapViewSavedInstanceState);
return view;
}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
this.mapView.getMapAsync(this);
if (mapView != null)
this.mapView.getMapAsync(this);
}

@Override
Expand Down Expand Up @@ -216,18 +215,10 @@ public void onCancel() {
}
});
} else {
this.contactTrianglifyView.getDrawable().setColorGenerator(new ContactColorGenerator());
this.contactTrianglifyView.getDrawable().setPointGenerator(new RegularPointGenerator());
this.contactTrianglifyView.setVisibility(View.VISIBLE);
this.contactPlaceholderImage.setVisibility(View.VISIBLE);
this.contactNameLayout.setBackgroundColor(ContextCompat.getColor(getActivity(), android.R.color.transparent));
this.contactNameLayout.setFocusable(false);
this.contactNameLayout.setClickable(false);
this.contactTrianglifyView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
collapseBottomSheet();
}
});
}

contactNameLayout.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -318,7 +309,8 @@ private boolean checkPlayServices() {
public void onSaveInstanceState(Bundle outState) {
//This MUST be done before saving any of your own or your base class's variables
final Bundle mapViewSaveState = new Bundle(outState);
this.mapView.onSaveInstanceState(mapViewSaveState);
if (mapView != null)
this.mapView.onSaveInstanceState(mapViewSaveState);
outState.putBundle(MAP_VIEW_SAVE_STATE, mapViewSaveState);
//Add any other variables here.
super.onSaveInstanceState(outState);
Expand Down Expand Up @@ -375,24 +367,28 @@ public void showErrorDialog() {
public void onDestroy() {
super.onDestroy();
this.contactPresenter.onDestroy();
this.mapView.onDestroy();
if (mapView != null)
this.mapView.onDestroy();
}

@Override
public void onResume() {
super.onResume();
this.mapView.onResume();
if (mapView != null)
this.mapView.onResume();
}

@Override
public void onPause() {
super.onPause();
this.mapView.onPause();
if (mapView != null)
this.mapView.onPause();
}

@Override
public void onLowMemory() {
super.onLowMemory();
this.mapView.onLowMemory();
if (mapView != null)
this.mapView.onLowMemory();
}
}

This file was deleted.

2 changes: 0 additions & 2 deletions app/src/main/java/com/appmatic/baseapp/main/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.appmatic.baseapp.api.models.AppContent;
import com.appmatic.baseapp.api.models.ExtraInfo;
import com.appmatic.baseapp.contact.ContactFragment;
import com.appmatic.baseapp.contact.trianglify.ContactColorGenerator;
import com.appmatic.baseapp.content_container.ContentContainerFragment;
import com.appmatic.baseapp.fcm.FCMHelper;
import com.appmatic.baseapp.fragments.BaseFragment;
Expand Down Expand Up @@ -257,7 +256,6 @@ public void handleFirstContentState(ArrayList<String> extraItems) {
addFragment(this.contentContainerFragment);
this.contentContainerFragment.updateFragmentContents(this.currentItem);
} else if (extraItems.contains(ExtraInfo.TYPE_CONTACT_ITEM)) {
ContactColorGenerator.initColors(this);
this.currentFragmentTag = ContentContainerFragment.class.toString();
addFragment(this.contactFragment);
showProgress(getString(R.string.loading), getString(R.string.loading_contact_msg));
Expand Down
15 changes: 8 additions & 7 deletions app/src/main/res/layout/fragment_contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
android:layout_marginBottom="80dp"
android:visibility="gone" />

<com.manolovn.trianglify.TrianglifyView
android:id="@+id/contact_trianglify_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="64dp"
<ImageView
android:id="@+id/contact_placeholder_image"
android:layout_width="48dp"
android:layout_height="48dp"
android:visibility="gone"
app:cellSize="175"
app:variance="75" />
android:background="@drawable/ic_account_circle_black_48dp"
android:layout_gravity="center"
android:layout_marginBottom="64dp"
android:alpha="0.2"/>

<include layout="@layout/contact_content" />

Expand Down
Loading

0 comments on commit e62d175

Please sign in to comment.