Skip to content

Commit

Permalink
💄 (About page) Change Share button location to side of the app logo.
Browse files Browse the repository at this point in the history
Removed contribution page
  • Loading branch information
iqfareez committed Oct 10, 2024
1 parent ad14480 commit 185c13d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 196 deletions.
2 changes: 0 additions & 2 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ const kOnboardingCoachmarkFlow = 'onboarding';
//Network image
const kAppIconUrl =
'https://firebasestorage.googleapis.com/v0/b/malaysia-waktu-solat.appspot.com/o/icon%20(Custom).png?alt=media&token=9efb706e-4bf3-4e60-af8e-9a88ee6db60c';
const kDeveloperActivityImage =
'https://firebasestorage.googleapis.com/v0/b/malaysia-waktu-solat.appspot.com/o/In%20app%2Fundraw_developer_activity_bv83.svg?alt=media&token=e787419a-fb75-4484-860d-512b4b634c97';

//Network Image (Scenery time images)
// const kWaktuSubuhImage =
Expand Down
6 changes: 0 additions & 6 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,7 @@
"notifSheetNotificationDescription": "We may require some permissions to be able to play the notification/azan",
"notifSheetNotificationPrimaryButton": "Turn On Notification",
"notifSheetNotificationCancel": "Keep it off for now",
"contributenDesc": "Alhamdulillah. If you love using our app and would like to show your appreciation, you can now make a financial contribution to support our ongoing efforts. May Allah SWT rewards your kindness.",
"contributeShare": "Share this app",
"contributeShareDesc": "Share your experience of using this app with your family and friends.",
"contributeShareNow": "Share now",
"contributeShareContent": "Hi. I'm using the Malaysia Prayer Time app. It's fast and free.\n\nTry it now:\n{playStoreShortLink} (Google Play)\n{webAppLink} (Web app)",
"@contributeShareContent": {
"placeholders": {
Expand All @@ -322,9 +319,6 @@
"contributeShareSubject": "Sharing MPT App",
"contributeCopy": "Copy",
"contributeOpen": "Open",
"contributeSource": "Contribute to source",
"contributeSourceDesc": "MPT app is open source. Report any bugs or contribute directly to the source code. It is licensed under GNU GPLv3.",
"contributeOpenGh": "Open GitHub",
"contributeCopied": "Copied to clipboard",
"notifTsAdmonition": "Your device may not be affected with this particular issue.",
"notifTsPara1": "Some apps installed from the **Google Play Store** will disable **Autostart** by default. Due to this behaviour, prayer notification (sometimes) will not appear on your phone.",
Expand Down
8 changes: 1 addition & 7 deletions lib/l10n/app_ms.arb
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,8 @@
"notifSheetNotificationDescription": "Kami mungkin memerlukan beberapa kebenaran untuk dapat memainkan pemberitahuan/azan",
"notifSheetNotificationPrimaryButton": "Hidupkan Pemberitahuan",
"notifSheetNotificationCancel": "Biar dimatikan untuk masa ini",
"contributenDesc": "Alhamdulillah. Saya menghargai niat anda untuk menderma ke aplikasi Waktu Solat Malaysia. Semoga Allah SWT membalas jasa baik kalian.",
"contributeShare": "Kongsi aplikasi ini",
"contributeShareDesc": "Kongsi pengalaman anda menggunakan aplikasi ini dengan keluarga dan rakan anda.",
"contributeShareNow": "Kongsi sekarang",
"contributeShareContent": "Hai. Saya menggunakan aplikasi Waktu Solat Malaysia. Ia pantas dan percuma.\n\nDapatkan sekarang:\n{playStoreShortLink} (Google Play)\n{webAppLink} (Web app)",
"contributeShareContent": "Hi. Saya menggunakan aplikasi Waktu Solat Malaysia. Ia pantas dan percuma.\n\nCuba sekarang:\n{playStoreShortLink} (Google Play)\n{webAppLink} (Apl web)",
"@contributeShareContent": {
"placeholders": {
"playStoreShortLink": {
Expand All @@ -218,9 +215,6 @@
"contributeShareSubject": "Berkongsi Aplikasi Waktu Solat",
"contributeCopy": "Salin",
"contributeOpen": "Buka",
"contributeSource": "Sumbang ke kod sumber",
"contributeSourceDesc": "Apl MPT ialah sumber terbuka. Laporkan sebarang pepijat atau sumbangkan terus kepada kod sumber. Ia dilesenkan di bawah GNU GPLv3.",
"contributeOpenGh": "Buka GitHub",
"contributeCopied": "Disalin ke papan keratan",
"notifTsAdmonition": "Peranti anda mungkin tidak terjejas dengan isu khusus ini.",
"notifTsPara1": "Sesetengah apl yang dipasang daripada **Gedung Google Play**, **Autostart** akan dilumpuhkan secara lalai. Disebabkan hal ini, pemberitahuan (kadang-kadang) tidak akan keluar pada telefon anda.",
Expand Down
120 changes: 0 additions & 120 deletions lib/views/contribution_page.dart

This file was deleted.

122 changes: 61 additions & 61 deletions lib/views/settings/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';

import '../../constants.dart';
import '../../env.dart';
import '../../providers/setting_provider.dart';
import '../../utils/launch_url.dart';
import '../contribution_page.dart';
import '../debug_dialog.dart';

class AboutAppPage extends StatelessWidget {
Expand All @@ -38,47 +38,70 @@ class AboutAppPage extends StatelessWidget {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
GestureDetector(
onLongPress: () {
if (isFirstTry && !setting.isDeveloperOption) {
Fluttertoast.showToast(msg: '(⌐■_■)');
isFirstTry = false;
} else {
if (!setting.isDeveloperOption) {
Fluttertoast.showToast(
msg: 'Developer mode discovered',
toastLength: Toast.LENGTH_LONG,
backgroundColor: Colors.teal);
Row(
mainAxisSize: MainAxisSize.min,
children: [
// Hack to make the app icon in the center
// The value is just I come up with by just eyeballing the logo to be in the center
// I tried with Stack and Positioned, but the IconButton's gesture didn't work
SizedBox(width: 42),
GestureDetector(
onLongPress: () {
if (isFirstTry && !setting.isDeveloperOption) {
Fluttertoast.showToast(msg: '(⌐■_■)');
isFirstTry = false;
} else {
if (!setting.isDeveloperOption) {
Fluttertoast.showToast(
msg: 'Developer mode discovered',
toastLength: Toast.LENGTH_LONG,
backgroundColor: Colors.teal);

setting.isDeveloperOption = true;
}
// Show the debug dialog
showDialog(
context: context,
builder: (context) => const DebugDialog(),
);
}
},
child: Hero(
tag: kAppIconTag,
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
child: CachedNetworkImage(
width: 70,
height: 70,
fit: BoxFit.scaleDown,
imageUrl: kAppIconUrl,
progressIndicatorBuilder:
(context, url, downloadProgress) => Padding(
padding: const EdgeInsets.all(18.0),
child: CircularProgressIndicator(
value: downloadProgress.progress),
setting.isDeveloperOption = true;
}
// Show the debug dialog
showDialog(
context: context,
builder: (context) => const DebugDialog(),
);
}
},
child: Hero(
tag: kAppIconTag,
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
child: CachedNetworkImage(
width: 70,
height: 70,
fit: BoxFit.scaleDown,
imageUrl: kAppIconUrl,
progressIndicatorBuilder:
(context, url, downloadProgress) => Padding(
padding: const EdgeInsets.all(18.0),
child: CircularProgressIndicator(
value: downloadProgress.progress),
),
errorWidget: (context, url, error) =>
const FaIcon(FontAwesomeIcons.exclamation),
),
),
errorWidget: (context, url, error) =>
const FaIcon(FontAwesomeIcons.exclamation),
),
),
),
// Share App Button
IconButton(
tooltip: AppLocalizations.of(context)!.contributeShare,
onPressed: () {
Share.share(
AppLocalizations.of(context)!
.contributeShareContent(
envPlayStoreListingShortLink,
envWebappUrl),
subject: AppLocalizations.of(context)!
.contributeShareSubject);
},
icon: Icon(Icons.adaptive.share),
)
],
),
const Text(
'\nMPT 2024',
Expand Down Expand Up @@ -114,29 +137,6 @@ class AboutAppPage extends StatelessWidget {
),
),
const SizedBox(height: 8),
Card(
clipBehavior: Clip.hardEdge,
child: InkWell(
child: ListTile(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4)),
title: Text(
AppLocalizations.of(context)!.aboutContribution,
textAlign: TextAlign.center,
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
settings: const RouteSettings(
name: 'Contribution Page'),
builder: (_) => const ContributionPage(),
),
);
},
),
),
),
Card(
clipBehavior: Clip.hardEdge,
child: ListTile(
Expand Down

1 comment on commit 185c13d

@iqfareez
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After

Image

Please sign in to comment.