Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rating and sharing features added #789

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static it.feio.android.omninotes.utils.ConstantsBase.INTENT_NOTE;
import static it.feio.android.omninotes.utils.ConstantsBase.PREF_PASSWORD;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
Expand All @@ -43,6 +44,7 @@
import androidx.fragment.app.FragmentManager;
import androidx.drawerlayout.widget.DrawerLayout;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
Expand Down Expand Up @@ -109,6 +111,21 @@ protected void onCreate (Bundle savedInstanceState) {

}

public void rate(View view){
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://play.google.com/store/apps/details?id="+getPackageName())));
}

public void share(View view){

Intent shareintent =new Intent();
shareintent.setAction(Intent.ACTION_SEND);
shareintent.putExtra(Intent.EXTRA_TEXT,"http://play.google.com/store/apps/details?id="+getPackageName());
shareintent.setType("text/plain");
startActivity(shareintent);

//startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://play.google.com/store/apps/details?id="+getPackageName())));
}

@Override
protected void onResume () {
super.onResume();
Expand Down
10 changes: 10 additions & 0 deletions omniNotes/src/main/res/drawable/ic_baseline_share_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
</vector>
10 changes: 10 additions & 0 deletions omniNotes/src/main/res/drawable/ic_baseline_star_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
</vector>
71 changes: 67 additions & 4 deletions omniNotes/src/main/res/layout/fragment_navigation_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
-->

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pixlui="http://schemas.android.com/apk/com.neopixl.pixlui"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/navigation_bg">
xmlns:pixlui="http://schemas.android.com/apk/com.neopixl.pixlui"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/navigation_bg">

<LinearLayout
android:id="@+id/left_drawer"
Expand Down Expand Up @@ -67,6 +68,68 @@
android:scrollingCache="false"
android:animationCache="false" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/icon_selector"
android:gravity="center_vertical"
android:orientation="horizontal"
android:onClick="rate"
android:paddingStart="@dimen/horizontal_margin">

<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:padding="4dp"
app:srcCompat="@drawable/ic_baseline_star_24" />


<TextView
android:text="RATE US"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingStart="@dimen/icon_text_margin"
android:textAllCaps="true"
android:textAppearance="@style/Text.Normal"
android:textColor="@color/drawer_text"
pixlui:typeface="Roboto-Regular.ttf"

/>



</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/icon_selector"
android:gravity="center_vertical"
android:orientation="horizontal"
android:onClick="share"
android:paddingStart="@dimen/horizontal_margin">

<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:padding="4dp"
app:srcCompat="@drawable/ic_baseline_share_24" />

<TextView
android:text="SHARE "
android:layout_width="wrap_content"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingStart="@dimen/icon_text_margin"
android:textAllCaps="true"
android:textAppearance="@style/Text.Normal"
android:textColor="@color/drawer_text"
pixlui:typeface="Roboto-Regular.ttf"

/>

</LinearLayout>

<include android:id="@+id/settings_view" layout="@layout/drawer_category_list_footer"/>

<it.feio.android.omninotes.models.views.NonScrollableListView
Expand Down