Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Finish moving to Github #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Boehrsi committed Feb 22, 2019
1 parent 3e4c0c8 commit faec153
Show file tree
Hide file tree
Showing 72 changed files with 3,497 additions and 1,349 deletions.
12 changes: 12 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.openxchange.oxtalk">

<!-- The INTERNET permission is required for development. Specifically,
Expand Down Expand Up @@ -42,5 +43,16 @@
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"
tools:replace="android:resource" />
</provider>
</application>
</manifest>
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
34 changes: 23 additions & 11 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,32 @@
* for more details.
*/

import 'dart:async';

import 'package:bloc/bloc.dart';
import 'package:delta_chat_core/delta_chat_core.dart';
import 'package:flutter/material.dart';
import 'package:ox_talk/source/base/bloc_delegate.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:ox_talk/source/log/bloc_delegate.dart';
import 'package:ox_talk/source/chatlist/create_chat.dart';
import 'package:ox_talk/source/contact/contact_change.dart';
import 'package:ox_talk/source/l10n/localizations.dart';
import 'package:ox_talk/source/login/login.dart';
import 'package:ox_talk/source/main/root.dart';
import 'package:ox_talk/source/main/splash.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:ox_talk/source/profile/edit_user_settings.dart';
import 'package:ox_talk/source/profile/edit_account_settings.dart';

void main() {
BlocSupervisor().delegate = DebugBlocDelegate();
runApp(new OxTalkApp());
}

class OxTalkApp extends StatelessWidget {

static const String ROUTES_ROOT = "/";

static const ROUTES_CONTACT_ADD = '/contactAdd';
static const ROUTES_EDIT_USER = '/editUser';
static const ROUTES_PROFILE_EDIT = '/profileEdit';
static const ROUTES_CHAT_CREATE = '/chatCreate';

@override
Widget build(BuildContext context) {
Expand All @@ -81,7 +84,11 @@ class OxTalkApp extends StatelessWidget {
initialRoute: ROUTES_ROOT,
routes: {
ROUTES_ROOT: (context) => _OxTalk(),
ROUTES_CONTACT_ADD: (context) => ContactChange(add: true,),
ROUTES_CONTACT_ADD: (context) => ContactChange(
contactAction: ContactAction.add,
),
ROUTES_PROFILE_EDIT: (context) => EditAccountSettings(),
ROUTES_CHAT_CREATE: (context) => CreateChat(),
},
);
}
Expand All @@ -93,8 +100,8 @@ class _OxTalk extends StatefulWidget {
}

class _OxTalkState extends State<_OxTalk> {
DeltaChatCore _core;
Context _context;
DeltaChatCore _core = DeltaChatCore();
Context _context = Context();
bool _coreLoaded = false;
bool _configured = false;

Expand All @@ -114,15 +121,21 @@ class _OxTalkState extends State<_OxTalk> {
}

void _initCoreAndContext() async {
_core = DeltaChatCore();
await _core.init();
_context = Context();
await _isConfigured();
await _setupDefaultValues();
setState(() {
_coreLoaded = true;
});
}

Future _setupDefaultValues() async {
String status = await _context.getConfigValue(Context.configSelfStatus);
if (status == AppLocalizations.of(context).deltaChatStatusDefaultValue) {
await _context.setConfigValue(Context.configSelfStatus, AppLocalizations.of(context).editUserSettingsStatusDefaultValue);
}
}

Future _isConfigured() async {
_configured = await _context.isConfigured();
}
Expand All @@ -140,5 +153,4 @@ class _OxTalkState extends State<_OxTalk> {
_configured = true;
});
}

}
Loading

0 comments on commit faec153

Please sign in to comment.