-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AppKillerManager and Smart App Rate libraries.
Minor fixes and cleanup.
- Loading branch information
Showing
15 changed files
with
148 additions
and
98 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,18 @@ package `in`.bitotsav.info.ui | |
import `in`.bitotsav.R | ||
import `in`.bitotsav.databinding.FragmentInfoBinding | ||
import `in`.bitotsav.info.ui.InfoPageFragment.InfoPage | ||
import `in`.bitotsav.shared.utils.getColorCompat | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import android.util.TypedValue | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.appcompat.content.res.AppCompatResources | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.FragmentManager | ||
import androidx.fragment.app.FragmentPagerAdapter | ||
import com.codemybrainsout.ratingdialog.RatingDialog | ||
import org.koin.androidx.viewmodel.ext.sharedViewModel | ||
|
||
|
||
|
@@ -40,6 +43,9 @@ class InfoFragment : Fragment() { | |
infoPager.offscreenPageLimit = PAGES - 1 | ||
infoPager.adapter = InfoPageAdapter(childFragmentManager) | ||
appBar.tabs.setupWithViewPager(infoPager) | ||
feedbackFab.setOnClickListener { | ||
feedback() | ||
} | ||
} | ||
.root | ||
|
||
|
@@ -57,4 +63,35 @@ class InfoFragment : Fragment() { | |
} | ||
} | ||
|
||
private fun feedback() { | ||
context?.let { | ||
val ratingDialog = RatingDialog.Builder(it) | ||
.icon(AppCompatResources.getDrawable(it, `in`.bitotsav.R.drawable.ic_bitotsav_red_24dp)!!) | ||
.threshold(4f) | ||
.title("How was your experience with us?") | ||
.positiveButtonText("Not Now") | ||
.negativeButtonText("Never") | ||
.formTitle("Submit Feedback") | ||
.formHint("Tell us where we can improve") | ||
.formSubmitText("Submit") | ||
.formCancelText("Cancel") | ||
.playstoreUrl("YOUR_URL") | ||
.onRatingBarFormSumbit { feedback -> | ||
val intent = Intent(Intent.ACTION_SENDTO).apply { | ||
data = Uri.parse("mailto:") | ||
putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]")) | ||
putExtra(Intent.EXTRA_SUBJECT, "Bitotsav '19 App Feedback") | ||
putExtra(Intent.EXTRA_TEXT, feedback) | ||
} | ||
activity?.packageManager?.let { packageManager -> | ||
if (intent.resolveActivity(packageManager) != null) { | ||
startActivity(intent) | ||
} | ||
} | ||
}.build() | ||
|
||
ratingDialog.show() | ||
} | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
package `in`.bitotsav.info.ui | ||
|
||
import `in`.bitotsav.shared.ui.BaseViewModel | ||
import androidx.lifecycle.ViewModel | ||
|
||
class InfoViewModel : BaseViewModel() { | ||
|
||
fun feedback() { | ||
|
||
} | ||
|
||
|
||
|
||
} | ||
class InfoViewModel : BaseViewModel() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.