its android time
This commit is contained in:
parent
55c6c92678
commit
726f3bebee
|
@ -3,7 +3,8 @@
|
|||
<application
|
||||
android:label="loris"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:usesCleartextTraffic="true">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
|
|
|
@ -208,7 +208,7 @@ void openBrowserForAuthCode(String baseurl, App app) {
|
|||
"&redirect_uri=${kIsWeb ? "${Uri.base.origin}/login/redirect.html" : "http://localhost:1312"}" +
|
||||
"&response_type=code");
|
||||
launchUrl(
|
||||
mode: LaunchMode.inAppWebView,
|
||||
mode: LaunchMode.externalApplication,
|
||||
url,
|
||||
webOnlyWindowName: "loris",
|
||||
webViewConfiguration: const WebViewConfiguration(),
|
||||
|
|
|
@ -127,58 +127,60 @@ class _FullPostViewState extends State<FullPostView> {
|
|||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String>(
|
||||
alignment: Alignment.center,
|
||||
value: activeIdentity,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
iconEnabledColor:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
items: dropdownButtons,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: identities[value]!,
|
||||
identities: identities,
|
||||
),
|
||||
);
|
||||
});
|
||||
loadPosts();
|
||||
},
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.spaceAround,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String>(
|
||||
alignment: Alignment.center,
|
||||
value: activeIdentity,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
iconEnabledColor:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
items: dropdownButtons,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: identities[value]!,
|
||||
identities: identities,
|
||||
),
|
||||
);
|
||||
});
|
||||
loadPosts();
|
||||
},
|
||||
),
|
||||
),
|
||||
if (sensitive || widget.forceSensitive)
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: widget.originPostModel,
|
||||
hidden: !widget.hidden,
|
||||
identities: identities,
|
||||
ancestors: ancestors,
|
||||
descendants: descendants,
|
||||
forceSensitive: true,
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
icon: Icon(widget.hidden
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off),
|
||||
label: Text(
|
||||
widget.hidden ? "show".i18n() : "hide".i18n(),
|
||||
),
|
||||
),
|
||||
if (sensitive || widget.forceSensitive)
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
Navigator.of(context).pop();
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: widget.originPostModel,
|
||||
hidden: !widget.hidden,
|
||||
identities: identities,
|
||||
ancestors: ancestors,
|
||||
descendants: descendants,
|
||||
forceSensitive: true,
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
icon: Icon(widget.hidden
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off),
|
||||
label: Text(
|
||||
widget.hidden ? "show".i18n() : "hide".i18n(),
|
||||
))
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
constraints: BoxConstraints(
|
||||
|
|
|
@ -118,6 +118,9 @@ class _ProfileViewState extends State<ProfileView> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
if (global.settings!.identities.length == 1) {
|
||||
loading = false;
|
||||
}
|
||||
activeIdentity = widget.model.identity;
|
||||
identities.addAll({widget.model.identity: widget.model});
|
||||
addRelationship(widget.model);
|
||||
|
|
|
@ -30,7 +30,6 @@ double getWidth(context) {
|
|||
BoxConstraints getConstraints(context) {
|
||||
return BoxConstraints(
|
||||
maxWidth: settings!.maxPostWidth,
|
||||
minWidth: 375,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ Locale activeLocale = const Locale("en_US");
|
|||
|
||||
void main() async {
|
||||
setPathUrlStrategy();
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
Intl.defaultLocale = "en_US";
|
||||
global.settings = await settings.Settings.create();
|
||||
activeLocale = global.settings!.locale;
|
||||
|
|
|
@ -29,7 +29,7 @@ class LogoutButton extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
return Wrap(
|
||||
children: [
|
||||
SelectableText(identity),
|
||||
TextButton.icon(
|
||||
|
|
|
@ -61,36 +61,38 @@ class _MainScaffoldState extends State<MainScaffold> {
|
|||
null,
|
||||
null,
|
||||
];
|
||||
return Scaffold(
|
||||
extendBody: true,
|
||||
body: IndexedStack(
|
||||
index: index,
|
||||
children: screens,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
floatingActionButton: buttons[index],
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: NavigationBar(
|
||||
onDestinationSelected: (index) => setState(() {
|
||||
this.index = index;
|
||||
if (index == 2) {
|
||||
unreadNotifs = 0;
|
||||
}
|
||||
}),
|
||||
selectedIndex: index,
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.forum), label: "timeline".i18n()),
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.chat), label: "chat".i18n()),
|
||||
NavigationDestination(
|
||||
icon: Icon((unreadNotifs >= 1)
|
||||
? Icons.notifications_active
|
||||
: Icons.notifications),
|
||||
label: "notifications".i18n()),
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.settings), label: "settings".i18n()),
|
||||
]),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
extendBody: true,
|
||||
body: IndexedStack(
|
||||
index: index,
|
||||
children: screens,
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
floatingActionButton: buttons[index],
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: NavigationBar(
|
||||
onDestinationSelected: (index) => setState(() {
|
||||
this.index = index;
|
||||
if (index == 2) {
|
||||
unreadNotifs = 0;
|
||||
}
|
||||
}),
|
||||
selectedIndex: index,
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.forum), label: "timeline".i18n()),
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.chat), label: "chat".i18n()),
|
||||
NavigationDestination(
|
||||
icon: Icon((unreadNotifs >= 1)
|
||||
? Icons.notifications_active
|
||||
: Icons.notifications),
|
||||
label: "notifications".i18n()),
|
||||
NavigationDestination(
|
||||
icon: const Icon(Icons.settings), label: "settings".i18n()),
|
||||
]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class _PostState extends State<Post> {
|
|||
);
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: c,
|
||||
);
|
||||
}
|
||||
|
@ -308,59 +308,45 @@ class PostActionBar extends StatefulWidget {
|
|||
class _PostActionBarState extends State<PostActionBar> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
return Wrap(
|
||||
alignment: WrapAlignment.spaceAround,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 20,
|
||||
child: IconButton(
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: ((context) => MakePost(
|
||||
inReplyTo: widget.model,
|
||||
)));
|
||||
},
|
||||
icon: const Icon(Icons.reply),
|
||||
tooltip: "reply".i18n(),
|
||||
),
|
||||
InteractionButton(
|
||||
model: widget.model,
|
||||
type: interactions.InteractionType.reblog,
|
||||
),
|
||||
InteractionButton(
|
||||
model: widget.model,
|
||||
type: interactions.InteractionType.favorite,
|
||||
),
|
||||
IconButton(
|
||||
tooltip: "show-in-full".i18n(),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: ((context) => MakePost(
|
||||
inReplyTo: widget.model,
|
||||
)));
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: widget.model,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.reply),
|
||||
tooltip: "reply".i18n(),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 20,
|
||||
child: InteractionButton(
|
||||
model: widget.model,
|
||||
type: interactions.InteractionType.reblog,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 20,
|
||||
child: InteractionButton(
|
||||
model: widget.model,
|
||||
type: interactions.InteractionType.favorite,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 20,
|
||||
child: IconButton(
|
||||
tooltip: "show-in-full".i18n(),
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => FullPostView(
|
||||
originPostModel: widget.model,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.open_in_full))),
|
||||
Expanded(
|
||||
flex: 20,
|
||||
child: IconButton(
|
||||
tooltip: "post-options".i18n(),
|
||||
onPressed: () {
|
||||
popupPostOptions(context, widget.model);
|
||||
},
|
||||
icon: const Icon(Icons.more_horiz),
|
||||
),
|
||||
icon: const Icon(Icons.open_in_full)),
|
||||
IconButton(
|
||||
tooltip: "post-options".i18n(),
|
||||
onPressed: () {
|
||||
popupPostOptions(context, widget.model);
|
||||
},
|
||||
icon: const Icon(Icons.more_horiz),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
@ -100,28 +100,25 @@ class _ThreadState extends State<Thread> {
|
|||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Container(
|
||||
clipBehavior: Clip.none,
|
||||
foregroundDecoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
Container(
|
||||
clipBehavior: Clip.none,
|
||||
foregroundDecoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
width: (MediaQuery.of(context).size.width *
|
||||
global.settings!.postWidth) -
|
||||
56,
|
||||
constraints: global.getConstraints(context),
|
||||
child: Material(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: c,
|
||||
),
|
||||
),
|
||||
width:
|
||||
(MediaQuery.of(context).size.width * global.settings!.postWidth) -
|
||||
56,
|
||||
constraints: global.getConstraints(context),
|
||||
child: Material(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: c,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue