Commit bac93547 authored by Mudar Noufal's avatar Mudar Noufal

TapTargetPrompt udpates

layout issue with fabMenu fixed :)
also added strings for AboutLibrarires
parent 50d43518
......@@ -30,10 +30,8 @@ import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import com.github.clans.fab.FloatingActionButton;
import com.github.clans.fab.FloatingActionMenu;
import com.mikepenz.aboutlibraries.LibsBuilder;
import ca.mudar.mtlaucasou.Const;
......@@ -161,7 +159,7 @@ public abstract class BaseActivity extends AppCompatActivity implements
.withFields(R.string.class.getFields()) // For Proguard
.withLibraries(// Added manually to avoid issues with Proguard
"GooglePlayServices", "bottombar", "materialloadingprogressbar",
"clansfloatingactionbutton", "AboutLibraries",
"clansfloatingactionbutton", "AboutLibraries", "materialtaptargetprompt",
"Crashlytics",
"Retrofit", "OkHttp", "Realm",
"gson", "appcompat_v7", "design", "recyclerview_v7"
......@@ -197,30 +195,14 @@ public abstract class BaseActivity extends AppCompatActivity implements
protected void showcaseMapLayers(@MapType String type) {
if (MapUtils.isMultiLayerMapType(type) &&
UserPrefs.getInstance(getApplicationContext()).shouldDisplayLayersShowcase()) {
// TODO remove this when issue fixed
// Ref: https://github.com/sjwall/MaterialTapTargetPrompt/issues/15
// Toggle the fabMenu dummy button
final FloatingActionButton dummy = (FloatingActionButton) findViewById(R.id.dummy_fab_menu);
dummy.setColorNormal(MapUtils.getMapTypeColor(getApplicationContext(), type));
dummy.setColorPressed(MapUtils.getMapTypeColor(getApplicationContext(), type));
dummy.setVisibility(View.VISIBLE);
final FloatingActionMenu fabMenu = (FloatingActionMenu) findViewById(R.id.fab_menu);
new MaterialTapTargetPrompt.Builder(this)
.setTarget(dummy)
.setTarget(fabMenu.getMenuIconView())
.setTargetRenderView(fabMenu)
.setPrimaryText(R.string.showcase_map_layers_title)
.setBackgroundColourFromRes(R.color.color_primary_dark)
.setSecondaryText(R.string.showcase_map_layers_desc)
.setOnHidePromptListener(new MaterialTapTargetPrompt.OnHidePromptListener() {
@Override
public void onHidePrompt(MotionEvent event, boolean tappedTarget) {
dummy.setVisibility(View.GONE);
}
@Override
public void onHidePromptComplete() {
// ignore
}
})
.show();
}
}
......
......@@ -3,17 +3,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<com.github.clans.fab.FloatingActionButton
android:id="@+id/dummy_fab_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
android:src="@drawable/ic_map_layers"
android:visibility="gone"
app:fab_size="normal" />
<com.github.clans.fab.FloatingActionMenu
android:id="@+id/fab_menu"
style="@style/FabMenu"
......
<?xml version="1.0" encoding="utf-8"?><!--
Montreal Just in Case
Copyright (C) 2011 Mudar Noufal <mn@mudar.ca>
Geographic locations of public safety services. A Montreal Open Data
project.
This file is part of Montreal Just in Case.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="UnusedResources">
<string name="define_int_materialtaptargetprompt" translatable="false">year;owner</string>
<!-- Author section -->
<string name="library_materialtaptargetprompt_author" translatable="false">Samuel Wall</string>
<string name="library_materialtaptargetprompt_authorWebsite" translatable="false">https://github.com/sjwall</string>
<!-- Library section -->
<string name="library_materialtaptargetprompt_libraryName" translatable="false">Material Tap Target Prompt</string>
<string name="library_materialtaptargetprompt_libraryDescription" translatable="false">A Tap Target implementation in Android based on Material Design Onboarding guidelines.</string>
<string name="library_materialtaptargetprompt_libraryWebsite" translatable="false">https://github.com/sjwall/MaterialTapTargetPrompt</string>
<string name="library_materialtaptargetprompt_libraryVersion" translatable="false">1.5.0</string>
<!-- OpenSource section -->
<string name="library_materialtaptargetprompt_isOpenSource" translatable="false">true</string>
<string name="library_materialtaptargetprompt_repositoryLink" translatable="false">https://github.com/sjwall/MaterialTapTargetPrompt</string>
<!-- ClassPath for autoDetect section -->
<string name="library_materialtaptargetprompt_classPath" translatable="false">uk.co.samuelwall.materialtaptargetprompt</string>
<!-- License section -->
<string name="library_materialtaptargetprompt_licenseId" translatable="false">apache_2_0</string>
<!-- Custom variables section -->
<string name="library_materialtaptargetprompt_year" translatable="false">2016</string>
<string name="library_materialtaptargetprompt_owner" translatable="false">Samuel Wall</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment