Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/Chat
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,3 +5,6 @@
|
||||
/PrototypChat/obj/Debug
|
||||
/PrototypChat/obj/Release
|
||||
/publish
|
||||
/BeWoPlanerChat/MyTestApplication
|
||||
/BeWoPlanerChat/bewoplaner-chat-android/app/*.apk
|
||||
/PrototypChat/.vs/PrototypChat/v14
|
||||
|
||||
Binary file not shown.
@@ -30,23 +30,21 @@ android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.2"
|
||||
defaultConfig {
|
||||
applicationId "com.p3.bewoplanner"
|
||||
applicationId "de.beyondsoft.ownchat"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file('../keystore.jks')
|
||||
storePassword 'Qva/F637QEDfM)Z]'
|
||||
keyAlias 'bewoplaner-chat'
|
||||
keyPassword 'q7vWk(V&R6+NVjvg'
|
||||
storeFile file('../ownChat.jks')
|
||||
storePassword 'jlzvnz9e4ur3gfk6hwsw'
|
||||
keyAlias 'ownChatKey'
|
||||
keyPassword '6fhnfqm07tvbagm3t6k4'
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
ext.enableCrashlytics = false
|
||||
@@ -61,7 +59,6 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
disable 'InvalidPackage'
|
||||
@@ -73,58 +70,45 @@ dependencies {
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
testCompile 'junit:junit:4.12'
|
||||
|
||||
// Android support libraries
|
||||
compile 'com.android.support:appcompat-v7:25.3.0'
|
||||
compile 'com.android.support:design:25.3.0'
|
||||
|
||||
// Butter Knife
|
||||
compile 'com.jakewharton:butterknife:8.4.0'
|
||||
apt 'com.jakewharton:butterknife-compiler:8.4.0'
|
||||
|
||||
// Dagger
|
||||
compile 'com.google.dagger:dagger:2.7'
|
||||
apt 'com.google.dagger:dagger-compiler:2.7'
|
||||
provided 'javax.annotation:jsr250-api:1.0'
|
||||
|
||||
// Rx Java
|
||||
compile 'io.reactivex:rxjava:1.1.6'
|
||||
compile 'io.reactivex:rxandroid:1.2.1'
|
||||
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
|
||||
|
||||
// Retrofit
|
||||
compile 'com.squareup.retrofit2:retrofit:2.1.0'
|
||||
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
|
||||
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
|
||||
|
||||
// OkHttp
|
||||
compile 'com.squareup.okhttp3:okhttp:3.4.1'
|
||||
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
|
||||
|
||||
// Glide
|
||||
compile 'com.github.bumptech.glide:glide:3.7.0'
|
||||
|
||||
// Circle ImageView
|
||||
compile 'de.hdodenhof:circleimageview:2.1.0'
|
||||
compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
|
||||
// Secure Preferences
|
||||
compile 'com.scottyab:secure-preferences-lib:0.1.4'
|
||||
|
||||
// Firebase
|
||||
compile 'com.google.firebase:firebase-messaging:10.2.0'
|
||||
|
||||
// emojis
|
||||
compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
|
||||
|
||||
// circle progress
|
||||
compile 'com.github.lzyzsd:circleprogress:1.2.1'
|
||||
|
||||
// event bus
|
||||
compile 'com.android.support:appcompat-v7:25.3.0'
|
||||
compile 'com.android.support:design:25.3.0'
|
||||
compile 'com.jakewharton:butterknife:8.4.0'
|
||||
compile 'com.google.dagger:dagger:2.7'
|
||||
compile 'io.reactivex:rxjava:1.1.6'
|
||||
compile 'io.reactivex:rxandroid:1.2.1'
|
||||
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
|
||||
compile 'com.squareup.retrofit2:retrofit:2.1.0'
|
||||
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
|
||||
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
|
||||
compile 'com.squareup.okhttp3:okhttp:3.4.1'
|
||||
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
|
||||
compile 'com.github.bumptech.glide:glide:3.7.0'
|
||||
compile 'de.hdodenhof:circleimageview:2.1.0'
|
||||
compile 'com.scottyab:secure-preferences-lib:0.1.4'
|
||||
compile 'com.google.firebase:firebase-messaging:10.2.0'
|
||||
compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
|
||||
compile 'com.github.lzyzsd:circleprogress:1.2.1'
|
||||
compile 'org.greenrobot:eventbus:3.0.0'
|
||||
testCompile 'junit:junit:4.12'
|
||||
apt 'com.jakewharton:butterknife-compiler:8.4.0'
|
||||
apt 'com.google.dagger:dagger-compiler:2.7'
|
||||
provided 'javax.annotation:jsr250-api:1.0'
|
||||
}
|
||||
|
||||
task adp2upload(type: Exec, dependsOn: "build") {
|
||||
@@ -133,7 +117,7 @@ task adp2upload(type: Exec, dependsOn: "build") {
|
||||
channel = "bewoplaner-chat"
|
||||
slug = "bewoplaner-chat"
|
||||
versionCode = rootProject.versionCode
|
||||
identifier = "com.p3.bewoplaner"
|
||||
identifier = "de.p3.bewoplaner"
|
||||
file = "build/outputs/apk/app-release.apk"
|
||||
notes = "Nightly build for BeWoPlaner Chat"
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:1021949586645:android:113c5b5fc97fb0bb",
|
||||
"android_client_info": {
|
||||
"package_name": "com.p3.bewoplanner"
|
||||
"package_name": "de.beyondsoft.ownchat"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
@@ -18,7 +18,7 @@
|
||||
"client_id": "1021949586645-vnidi5tjof2kgsal6qgqrbokel0q0hvi.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.p3.bewoplanner",
|
||||
"package_name": "de.beyondsoft.ownchat",
|
||||
"certificate_hash": "349feb470feaf535c1074c91721714ced3d81f0c"
|
||||
}
|
||||
},
|
||||
@@ -26,7 +26,7 @@
|
||||
"client_id": "1021949586645-ttle1pv465pp7gdigqh93futan4cmn8p.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.p3.bewoplanner",
|
||||
"package_name": "de.beyondsoft.ownchat",
|
||||
"certificate_hash": "458abe7a8928c32f3ad3fbcc575373b613070aae"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner;
|
||||
package de.beyondsoft.ownchat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.p3.bewoplanner", appContext.getPackageName());
|
||||
assertEquals("de.beyondsoft.ownchat", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.p3.bewoplaner">
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="de.beyondsoft.ownchat">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
@@ -9,54 +10,49 @@
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application
|
||||
android:name="com.p3.bewoplaner.BewoplanerApplication"
|
||||
android:name="de.beyondsoft.ownchat.BewoplanerApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name="com.p3.bewoplaner.page.splash.SplashActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.splash.SplashActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.FullBackground">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".page.login.LoginActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.login.LoginActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.FullBackground" />
|
||||
|
||||
<activity
|
||||
android:name=".page.main.MainActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.main.MainActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".page.impressum.ImpressumActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.impressum.ImpressumActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".page.chat.SingleChatActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.chat.SingleChatActivity"
|
||||
android:label=""
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/ChatStyle" />
|
||||
|
||||
<activity
|
||||
android:name=".page.chat.GroupChatActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.chat.GroupChatActivity"
|
||||
android:label=""
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/ChatStyle" />
|
||||
|
||||
<activity
|
||||
android:name=".page.chatmembers.ChatMembersActivity"
|
||||
android:name="de.beyondsoft.ownchat.page.chatmembers.ChatMembersActivity"
|
||||
android:label=""
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/ChatStyle" />
|
||||
@@ -65,15 +61,15 @@
|
||||
android:name="io.fabric.ApiKey"
|
||||
android:value="1dcc8d0ead50f1b328778876834fea3392c6fc22" />
|
||||
|
||||
<service android:name=".data.firebase.MessagingInstanceIdService">
|
||||
<service android:name="de.beyondsoft.ownchat.data.firebase.MessagingInstanceIdService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".utils.AppStoppedService" android:stopWithTask="false"/>
|
||||
|
||||
<service android:name=".data.firebase.HandleMessagesService">
|
||||
<service
|
||||
android:name="de.beyondsoft.ownchat.utils.AppStoppedService"
|
||||
android:stopWithTask="false" />
|
||||
<service android:name="de.beyondsoft.ownchat.data.firebase.HandleMessagesService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
@@ -90,7 +86,7 @@
|
||||
</provider>
|
||||
|
||||
<receiver
|
||||
android:name=".data.firebase.ReplyNotificationReceiver"
|
||||
android:name="de.beyondsoft.ownchat.data.firebase.ReplyNotificationReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false" />
|
||||
|
||||
@@ -100,6 +96,8 @@
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_color"
|
||||
android:resource="@color/colorDefault" />
|
||||
|
||||
<activity android:name="de.beyondsoft.ownchat.page.fileconfirmation.FileConfirmationActivity"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.p3.bewoplaner.data.api.common;
|
||||
|
||||
import com.p3.bewoplaner.data.events.InvalidTokenEvent;
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import rx.Observable;
|
||||
import rx.functions.Func1;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
public class ErrorHandlingResponseConverter<T extends BaseResponse>
|
||||
implements Func1<T, Observable<T>> {
|
||||
|
||||
@Override
|
||||
public Observable<T> call(T t) {
|
||||
if (!t.success) {
|
||||
if (t.errors.token != null) {
|
||||
EventBus.getDefault().post(new InvalidTokenEvent());
|
||||
return Observable.error(new ErrorThrowable(ErrorType.INVALID_TOKEN, t.errors));
|
||||
}
|
||||
return Observable.error(new ErrorThrowable(ErrorType.DATA_INPUT, t.errors));
|
||||
}
|
||||
return Observable.just(t);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.p3.bewoplaner.data.api.common;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
public enum ErrorType {
|
||||
|
||||
/**
|
||||
* Unexpected/unknown error
|
||||
*/
|
||||
UNKNOWN,
|
||||
/**
|
||||
* Wrong query parameters
|
||||
*/
|
||||
DATA_INPUT,
|
||||
|
||||
/**
|
||||
* Expired/invalid token
|
||||
*/
|
||||
INVALID_TOKEN
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.p3.bewoplaner.data.api.services;
|
||||
|
||||
import com.p3.bewoplaner.data.api.responses.ProfileResponse;
|
||||
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
import rx.Observable;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
public interface LoginService {
|
||||
@FormUrlEncoded
|
||||
@POST("api/user/login")
|
||||
Observable<ProfileResponse> login(
|
||||
@Field("username") String username,
|
||||
@Field("password") String password
|
||||
);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.p3.bewoplaner.data.api.services;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
import rx.Observable;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 24/03/2017.
|
||||
*/
|
||||
public interface VoucherService {
|
||||
|
||||
@GET("voucher_check.php")
|
||||
Observable<JsonObject> checkVoucher(
|
||||
@Query("k") String customerId,
|
||||
@Query("Voucher") String voucher);
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.p3.bewoplaner.data.events;
|
||||
|
||||
public class LogoutDirectlyEvent {
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.p3.bewoplaner.di;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 24/03/2017.
|
||||
*/
|
||||
@Qualifier
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface VoucherEndpoint {
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.p3.bewoplaner.page.login;
|
||||
|
||||
import com.p3.bewoplaner.data.api.services.LoginService;
|
||||
import com.p3.bewoplaner.data.api.services.RegisterService;
|
||||
import com.p3.bewoplaner.data.api.services.VoucherService;
|
||||
import com.p3.bewoplaner.di.P3DSEndpoint;
|
||||
import com.p3.bewoplaner.di.VoucherEndpoint;
|
||||
import com.p3.bewoplaner.di.scopes.ActivityScope;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
@Module
|
||||
public class LoginModule {
|
||||
|
||||
@Provides
|
||||
@ActivityScope
|
||||
LoginService provideLoginService(@P3DSEndpoint Retrofit retrofit) {
|
||||
return retrofit.create(LoginService.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ActivityScope
|
||||
RegisterService provideRegisterService(@P3DSEndpoint Retrofit retrofit) {
|
||||
return retrofit.create(RegisterService.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ActivityScope
|
||||
VoucherService provideVoucherService(@VoucherEndpoint Retrofit retrofit) {
|
||||
return retrofit.create(VoucherService.class);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.p3.bewoplaner.page.login;
|
||||
|
||||
import com.p3.bewoplaner.page.main.LogoutNavigation;
|
||||
import com.p3.bewoplaner.page.main.MainNavigation;
|
||||
import com.p3.bewoplaner.page.mvp.MVPLceView;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
interface LoginView extends MVPLceView {
|
||||
void loginSuccessful();
|
||||
|
||||
void setCallback(Callback callback);
|
||||
|
||||
void voucherIsValid();
|
||||
|
||||
void voucherIsNotValid();
|
||||
|
||||
interface Callback {
|
||||
|
||||
void checkVoucher(String customerId, String voucher, String password, boolean isChecked);
|
||||
|
||||
void tryToLogin(String email, String password);
|
||||
|
||||
void tryToRegisterDevice(String deviceId, String fcmToken);
|
||||
|
||||
void logout(String deviceId, boolean clearAllPrefs, MainNavigation mainNavigation);
|
||||
|
||||
void tryToLogout(String deviceId, MainNavigation mainNavigation);
|
||||
|
||||
void checkIfVoucherStillAvailable(LogoutNavigation logoutNavigation);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.p3.bewoplaner.page.main;
|
||||
|
||||
public interface LogoutNavigation {
|
||||
|
||||
void logoutDirectly();
|
||||
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.p3.bewoplaner;
|
||||
package de.beyondsoft.ownchat;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.p3.bewoplaner.data.firebase.MessagingInstanceIdService;
|
||||
import com.p3.bewoplaner.di.ApplicationComponent;
|
||||
import com.p3.bewoplaner.di.ApplicationModule;
|
||||
import com.p3.bewoplaner.di.DaggerApplicationComponent;
|
||||
import com.p3.bewoplaner.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.data.firebase.MessagingInstanceIdService;
|
||||
import de.beyondsoft.ownchat.di.ApplicationComponent;
|
||||
import de.beyondsoft.ownchat.di.ApplicationModule;
|
||||
import de.beyondsoft.ownchat.di.DaggerApplicationComponent;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
@@ -22,19 +22,24 @@ public class BewoplanerApplication extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
Realm.init(this);
|
||||
|
||||
if (!BuildConfig.DEBUG) {
|
||||
Fabric.with(this, new Crashlytics());
|
||||
}
|
||||
|
||||
buildGraphAndInject();
|
||||
MessagingInstanceIdService.setApplicationContext(this);
|
||||
}
|
||||
|
||||
private void buildGraphAndInject() {
|
||||
final ApplicationModule applicationModule = new ApplicationModule(this);
|
||||
|
||||
mApplicationComponent = DaggerApplicationComponent.builder()
|
||||
.applicationModule(applicationModule)
|
||||
.build();
|
||||
|
||||
mApplicationComponent.inject(this);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data;
|
||||
package de.beyondsoft.ownchat.data;
|
||||
|
||||
/**
|
||||
* Created by imarneanu on 2/10/17.
|
||||
@@ -15,4 +15,7 @@ public interface AppPrefsConstants {
|
||||
String PHONE_NUMBER = "phone_number";
|
||||
String CHAT_OPENED = "chat_opened";
|
||||
String APP_KILLED = "app_killed";
|
||||
String UPLOAD_MAX_SIZE = "upload_max_size";
|
||||
String IS_EMPLOYEE = "is_employee";
|
||||
String SHOW_LOGIN_AGAIN = "show_login_again";
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.p3.bewoplaner.data.api;
|
||||
package de.beyondsoft.ownchat.data.api;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import com.p3.bewoplaner.BewoplanerApplication;
|
||||
import com.p3.bewoplaner.BuildConfig;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.prefs.StringPreference;
|
||||
import com.p3.bewoplaner.di.P3DSEndpoint;
|
||||
import com.p3.bewoplaner.di.VoucherEndpoint;
|
||||
import com.p3.bewoplaner.di.scopes.ApplicationScope;
|
||||
import com.p3.bewoplaner.utils.Constants;
|
||||
import de.beyondsoft.ownchat.BewoplanerApplication;
|
||||
import de.beyondsoft.ownchat.BuildConfig;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.prefs.StringPreference;
|
||||
import de.beyondsoft.ownchat.di.P3DSEndpoint;
|
||||
import de.beyondsoft.ownchat.di.scopes.ApplicationScope;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -53,6 +52,7 @@ public class ApiModule {
|
||||
} else {
|
||||
interceptor.setLevel(HttpLoggingInterceptor.Level.NONE);
|
||||
}
|
||||
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
@@ -66,12 +66,15 @@ public class ApiModule {
|
||||
if (token.isSet()) {
|
||||
builder.addHeader("Token", token.get());
|
||||
}
|
||||
|
||||
if (customerId.isSet()) {
|
||||
builder.addHeader("CustomerID", customerId.get());
|
||||
}
|
||||
|
||||
if (isHeaderSet) {
|
||||
return chain.proceed(builder.build());
|
||||
}
|
||||
|
||||
return chain.proceed(original.newBuilder().build());
|
||||
};
|
||||
}
|
||||
@@ -79,9 +82,7 @@ public class ApiModule {
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@P3DSEndpoint
|
||||
OkHttpClient provideP3DSOkHttpClient(Cache cache,
|
||||
HttpLoggingInterceptor loggingInterceptor,
|
||||
Interceptor interceptor) {
|
||||
OkHttpClient provideP3DSOkHttpClient(Cache cache, HttpLoggingInterceptor loggingInterceptor, Interceptor interceptor) {
|
||||
return new OkHttpClient.Builder()
|
||||
.cache(cache)
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
@@ -92,17 +93,6 @@ public class ApiModule {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@VoucherEndpoint
|
||||
OkHttpClient provideVoucherkHttpClient(Cache cache,
|
||||
HttpLoggingInterceptor loggingInterceptor) {
|
||||
return new OkHttpClient.Builder()
|
||||
.cache(cache)
|
||||
.addInterceptor(loggingInterceptor)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
CallAdapter.Factory provideCallAdapterFactory() {
|
||||
@@ -137,18 +127,4 @@ public class ApiModule {
|
||||
.client(okHttpClient)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@VoucherEndpoint
|
||||
Retrofit provideVoucherRetrofit(@VoucherEndpoint final OkHttpClient okHttpClient,
|
||||
final Converter.Factory converter,
|
||||
final CallAdapter.Factory adapterFactory) {
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(Constants.VOUCHER_ENDPOINT)
|
||||
.addCallAdapterFactory(adapterFactory)
|
||||
.addConverterFactory(converter)
|
||||
.client(okHttpClient)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package de.beyondsoft.ownchat.data.api.common;
|
||||
|
||||
import de.beyondsoft.ownchat.data.events.InvalidTokenEvent;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import rx.Observable;
|
||||
import rx.functions.Func1;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
public class ErrorHandlingResponseConverter<T extends BaseResponse> implements Func1<T, Observable<T>> {
|
||||
|
||||
@Override
|
||||
public Observable<T> call(T t) {
|
||||
if (!t.success) {
|
||||
if (t.errors.token != null) {
|
||||
EventBus.getDefault().post(new InvalidTokenEvent());
|
||||
return Observable.error(new ErrorThrowable(ErrorType.INVALID_TOKEN, t.errors));
|
||||
}
|
||||
|
||||
if(t.errors.chatCodeFailed != null) {
|
||||
return Observable.error(new ErrorThrowable(ErrorType.WRONG_CHATCODE, t.errors));
|
||||
}
|
||||
|
||||
if(t.errors.chatCodeInactive != null) {
|
||||
return Observable.error(new ErrorThrowable(ErrorType.DEACTIVATED_CHATCODE, t.errors));
|
||||
}
|
||||
|
||||
if(t.errors.chatCodeTooShort != null) {
|
||||
return Observable.error(new ErrorThrowable(ErrorType.CHATCODE_TOO_SHORT, t.errors));
|
||||
}
|
||||
|
||||
return Observable.error(new ErrorThrowable(ErrorType.DATA_INPUT, t.errors));
|
||||
}
|
||||
|
||||
return Observable.just(t);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.api.common;
|
||||
package de.beyondsoft.ownchat.data.api.common;
|
||||
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
@@ -0,0 +1,36 @@
|
||||
package de.beyondsoft.ownchat.data.api.common;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
public enum ErrorType {
|
||||
|
||||
/**
|
||||
* Unexpected/unknown error
|
||||
*/
|
||||
UNKNOWN,
|
||||
/**
|
||||
* Wrong query parameters
|
||||
*/
|
||||
DATA_INPUT,
|
||||
|
||||
/**
|
||||
* Expired/invalid token
|
||||
*/
|
||||
INVALID_TOKEN,
|
||||
|
||||
/**
|
||||
* Deactivated chat code
|
||||
*/
|
||||
DEACTIVATED_CHATCODE,
|
||||
|
||||
/**
|
||||
* Wrong chat code
|
||||
*/
|
||||
WRONG_CHATCODE,
|
||||
|
||||
/**
|
||||
* The chat code is too short
|
||||
*/
|
||||
CHATCODE_TOO_SHORT
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.api.common;
|
||||
package de.beyondsoft.ownchat.data.api.common;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/23/17.
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.data.api.responses;
|
||||
package de.beyondsoft.ownchat.data.api.responses;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.p3.bewoplaner.data.api.responses;
|
||||
package de.beyondsoft.ownchat.data.api.responses;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 08/03/2017.
|
||||
@@ -15,7 +16,7 @@ public class MessageResponse extends BaseResponse {
|
||||
public static class Response {
|
||||
|
||||
@SerializedName("message")
|
||||
public com.p3.bewoplaner.model.Message message;
|
||||
public Message message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.p3.bewoplaner.data.api.responses;
|
||||
package de.beyondsoft.ownchat.data.api.responses;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
|
||||
/**
|
||||
* Created by imarneanu on 3/1/17.
|
||||
*/
|
||||
@@ -16,7 +18,7 @@ public class MessagesResponse extends BaseResponse {
|
||||
public static class Response {
|
||||
|
||||
@SerializedName("messages")
|
||||
public ArrayList<com.p3.bewoplaner.model.Message> messages;
|
||||
public ArrayList<Message> messages;
|
||||
|
||||
@SerializedName("hasMorePages")
|
||||
public boolean hasMorePages;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.data.api.responses;
|
||||
package de.beyondsoft.ownchat.data.api.responses;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
/**
|
||||
* Created by imarneanu on 2/23/17.
|
||||
@@ -16,6 +16,5 @@ public class ProfileResponse extends BaseResponse {
|
||||
|
||||
@SerializedName("user")
|
||||
public User user;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.data.api.responses;
|
||||
package de.beyondsoft.ownchat.data.api.responses;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/28/17.
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.p3.bewoplaner.data.api.responses;
|
||||
package de.beyondsoft.ownchat.data.api.responses;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.p3.bewoplaner.model.common.BaseResponse;
|
||||
import de.beyondsoft.ownchat.model.common.BaseResponse;
|
||||
|
||||
/**
|
||||
* Created by Vlad on 28/02/2017.
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.data.api.services;
|
||||
package de.beyondsoft.ownchat.data.api.services;
|
||||
|
||||
import com.p3.bewoplaner.data.api.responses.GroupResponse;
|
||||
import com.p3.bewoplaner.data.api.responses.MessageResponse;
|
||||
import com.p3.bewoplaner.data.api.responses.MessagesResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.GroupResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.MessageResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.MessagesResponse;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
@@ -39,5 +39,4 @@ public interface ChatService {
|
||||
Observable<MessageResponse> sendMessage(
|
||||
@Field("groupid") long groupId,
|
||||
@Field("text") String text);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package de.beyondsoft.ownchat.data.api.services;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import de.beyondsoft.ownchat.data.api.responses.ProfileResponse;
|
||||
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Path;
|
||||
import rx.Observable;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
public interface LoginService {
|
||||
@FormUrlEncoded
|
||||
@POST("api/user/login")
|
||||
Observable<ProfileResponse> login(
|
||||
@Field("username") String username,
|
||||
@Field("password") String password
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("api/user/loginwithchatcode")
|
||||
Observable<ProfileResponse> loginWithChatCode(
|
||||
@Field("username") String username,
|
||||
@Field("password") String password,
|
||||
@Field("chatcode") String chatcode
|
||||
);
|
||||
|
||||
@GET("https://dict.ownchat.de/api/server/resolve/{type}/{customerid}")
|
||||
Observable<JsonObject> getServiceType(@Path("type") String type, @Path("customerid") String customerId);
|
||||
|
||||
@GET("api/ownchat/uploadmaxsize")
|
||||
Observable<JsonObject> getUploadMaxSize();
|
||||
|
||||
@GET("api/ownchat/chatcode/verify/{customerid}/{userid}/{chatcode}")
|
||||
Observable<JsonObject> verifyChatCode(@Path("customerid") String customerid, @Path("userid") String userid, @Path("chatcode") String chatcode);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.p3.bewoplaner.data.api.services;
|
||||
package de.beyondsoft.ownchat.data.api.services;
|
||||
|
||||
import com.p3.bewoplaner.data.api.responses.ProfileResponse;
|
||||
import com.p3.bewoplaner.data.api.responses.UploadImageResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.ProfileResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.UploadImageResponse;
|
||||
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.api.services;
|
||||
package de.beyondsoft.ownchat.data.api.services;
|
||||
|
||||
import com.p3.bewoplaner.data.api.responses.RegisterResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.RegisterResponse;
|
||||
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.events;
|
||||
package de.beyondsoft.ownchat.data.events;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 31/03/2017.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.events;
|
||||
package de.beyondsoft.ownchat.data.events;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 27/03/2017.
|
||||
@@ -0,0 +1,4 @@
|
||||
package de.beyondsoft.ownchat.data.events;
|
||||
|
||||
public class LogoutDirectlyEvent {
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package com.p3.bewoplaner.data.firebase;
|
||||
package de.beyondsoft.ownchat.data.firebase;
|
||||
|
||||
import com.google.firebase.messaging.FirebaseMessagingService;
|
||||
import com.google.firebase.messaging.RemoteMessage;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.data.repository.GroupRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.MessageRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupByIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.MessageByIdSpecification;
|
||||
import com.p3.bewoplaner.di.InjectionHelper;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.main.MainActivity;
|
||||
import com.p3.bewoplaner.utils.Constants;
|
||||
import com.p3.bewoplaner.utils.LoggedOutUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.data.repository.GroupRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.MessageRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupByIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.MessageByIdSpecification;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.main.MainActivity;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
import de.beyondsoft.ownchat.utils.LoggedOutUtils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Notification;
|
||||
@@ -48,7 +48,7 @@ import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import static android.graphics.BitmapFactory.decodeStream;
|
||||
import static com.p3.bewoplaner.utils.Constants.CHAT_IS_ALREADY_OPEN;
|
||||
import static de.beyondsoft.ownchat.utils.Constants.CHAT_IS_ALREADY_OPEN;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 3/1/17.
|
||||
@@ -71,9 +71,11 @@ public class HandleMessagesService extends FirebaseMessagingService {
|
||||
@Override
|
||||
public void onMessageReceived(RemoteMessage remoteMessage) {
|
||||
InjectionHelper.getMessagingComponent(this).inject(HandleMessagesService.this);
|
||||
|
||||
if (mLoggedOutUtils.checkLoggedOutPrefs()) {
|
||||
return;
|
||||
}
|
||||
|
||||
customizeNotification(remoteMessage.getData());
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.data.firebase;
|
||||
package de.beyondsoft.ownchat.data.firebase;
|
||||
|
||||
import com.p3.bewoplaner.di.ApplicationComponent;
|
||||
import com.p3.bewoplaner.di.scopes.ActivityScope;
|
||||
import com.p3.bewoplaner.page.chat.ChatModule;
|
||||
import com.p3.bewoplaner.page.login.LoginModule;
|
||||
import de.beyondsoft.ownchat.di.ApplicationComponent;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
import de.beyondsoft.ownchat.page.chat.ChatModule;
|
||||
import de.beyondsoft.ownchat.page.login.LoginModule;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.p3.bewoplaner.data.firebase;
|
||||
package de.beyondsoft.ownchat.data.firebase;
|
||||
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
import com.google.firebase.iid.FirebaseInstanceIdService;
|
||||
|
||||
import com.p3.bewoplaner.BewoplanerApplication;
|
||||
import com.p3.bewoplaner.data.api.responses.RegisterResponse;
|
||||
import com.p3.bewoplaner.data.api.services.RegisterService;
|
||||
import com.p3.bewoplaner.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.BewoplanerApplication;
|
||||
import de.beyondsoft.ownchat.data.api.responses.RegisterResponse;
|
||||
import de.beyondsoft.ownchat.data.api.services.RegisterService;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
@@ -1,23 +1,23 @@
|
||||
package com.p3.bewoplaner.data.firebase;
|
||||
package de.beyondsoft.ownchat.data.firebase;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.api.common.ErrorHandlingResponseConverter;
|
||||
import com.p3.bewoplaner.data.api.responses.MessageResponse;
|
||||
import com.p3.bewoplaner.data.api.services.ChatService;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.data.prefs.StringPreference;
|
||||
import com.p3.bewoplaner.data.repository.GroupRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.MessageRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.RealmProvider;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupByIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.MessageByIdSpecification;
|
||||
import com.p3.bewoplaner.di.InjectionHelper;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.chat.ChatPresenter;
|
||||
import com.p3.bewoplaner.utils.Constants;
|
||||
import com.p3.bewoplaner.utils.rx.RxUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.api.common.ErrorHandlingResponseConverter;
|
||||
import de.beyondsoft.ownchat.data.api.responses.MessageResponse;
|
||||
import de.beyondsoft.ownchat.data.api.services.ChatService;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.data.prefs.StringPreference;
|
||||
import de.beyondsoft.ownchat.data.repository.GroupRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.MessageRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.RealmProvider;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupByIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.MessageByIdSpecification;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.chat.ChatPresenter;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
import de.beyondsoft.ownchat.utils.rx.RxUtils;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -37,7 +37,7 @@ import javax.inject.Named;
|
||||
import rx.Observable;
|
||||
import rx.Subscriber;
|
||||
|
||||
import static com.p3.bewoplaner.utils.Constants.GROUP_ID;
|
||||
import static de.beyondsoft.ownchat.utils.Constants.GROUP_ID;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 3/20/17.
|
||||
@@ -91,6 +91,7 @@ public class ReplyNotificationReceiver extends BroadcastReceiver {
|
||||
|
||||
Bundle bundle = intent.getBundleExtra(BUNDLE);
|
||||
long groupId = bundle.getLong(Constants.GROUP_ID);
|
||||
|
||||
if (replyMessage != null && replyMessage instanceof String) {
|
||||
sendMessage(context, (String) replyMessage, (int) groupId);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.prefs;
|
||||
package de.beyondsoft.ownchat.data.prefs;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.data.prefs;
|
||||
package de.beyondsoft.ownchat.data.prefs;
|
||||
|
||||
import com.p3.bewoplaner.BewoplanerApplication;
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.di.scopes.ApplicationScope;
|
||||
import de.beyondsoft.ownchat.BewoplanerApplication;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.di.scopes.ApplicationScope;
|
||||
import com.securepreferences.SecurePreferences;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -110,4 +110,24 @@ public class AppPrefsModule {
|
||||
return new BooleanPreference(sharedPreferences, AppPrefsConstants.APP_KILLED);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@Named(AppPrefsConstants.UPLOAD_MAX_SIZE)
|
||||
LongPreference provideUploadMaxSize(@AppPrefs SharedPreferences sharedPreferences) {
|
||||
return new LongPreference(sharedPreferences, AppPrefsConstants.UPLOAD_MAX_SIZE);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@Named(AppPrefsConstants.IS_EMPLOYEE)
|
||||
BooleanPreference provideIsEmployee(@AppPrefs SharedPreferences sharedPreferences) {
|
||||
return new BooleanPreference(sharedPreferences, AppPrefsConstants.IS_EMPLOYEE);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ApplicationScope
|
||||
@Named(AppPrefsConstants.SHOW_LOGIN_AGAIN)
|
||||
BooleanPreference provideShowLoginAgain(@AppPrefs SharedPreferences sharedPreferences) {
|
||||
return new BooleanPreference(sharedPreferences, AppPrefsConstants.SHOW_LOGIN_AGAIN);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.prefs;
|
||||
package de.beyondsoft.ownchat.data.prefs;
|
||||
|
||||
import com.securepreferences.SecurePreferences;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.prefs;
|
||||
package de.beyondsoft.ownchat.data.prefs;
|
||||
|
||||
import com.securepreferences.SecurePreferences;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.prefs;
|
||||
package de.beyondsoft.ownchat.data.prefs;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.NonNull;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.prefs;
|
||||
package de.beyondsoft.ownchat.data.prefs;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.support.annotation.NonNull;
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.mapper.Mapper;
|
||||
import com.p3.bewoplaner.data.repository.models.GroupRealm;
|
||||
import com.p3.bewoplaner.data.repository.models.UserRealm;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupByIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.RealmSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.Specification;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.data.repository.mapper.Mapper;
|
||||
import de.beyondsoft.ownchat.data.repository.models.GroupRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.UserRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupByIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.RealmSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.Specification;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.mapper.Mapper;
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import com.p3.bewoplaner.data.repository.specifications.MessageByIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.RealmSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.Specification;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import de.beyondsoft.ownchat.data.repository.mapper.Mapper;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.MessageByIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.RealmSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.Specification;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmConfiguration;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import io.realm.Realm;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.specifications.Specification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.Specification;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.mapper.Mapper;
|
||||
import com.p3.bewoplaner.data.repository.models.GroupRealm;
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import com.p3.bewoplaner.data.repository.models.UserRealm;
|
||||
import com.p3.bewoplaner.di.scopes.ApplicationScope;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.data.repository.mapper.Mapper;
|
||||
import de.beyondsoft.ownchat.data.repository.models.GroupRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.UserRealm;
|
||||
import de.beyondsoft.ownchat.di.scopes.ApplicationScope;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.p3.bewoplaner.data.repository;
|
||||
package de.beyondsoft.ownchat.data.repository;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.mapper.Mapper;
|
||||
import com.p3.bewoplaner.data.repository.models.UserRealm;
|
||||
import com.p3.bewoplaner.data.repository.specifications.RealmSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.Specification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.UserByIdSpecification;
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.data.repository.mapper.Mapper;
|
||||
import de.beyondsoft.ownchat.data.repository.models.UserRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.RealmSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.Specification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.UserByIdSpecification;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.repository.mapper;
|
||||
package de.beyondsoft.ownchat.data.repository.mapper;
|
||||
|
||||
/**
|
||||
* Class responsible for mapping one object to another.
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.data.repository.models;
|
||||
package de.beyondsoft.ownchat.data.repository.models;
|
||||
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.models;
|
||||
package de.beyondsoft.ownchat.data.repository.models;
|
||||
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.models;
|
||||
package de.beyondsoft.ownchat.data.repository.models;
|
||||
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
import io.realm.RealmObject;
|
||||
import io.realm.annotations.PrimaryKey;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.GroupRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.GroupRealm;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmQuery;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.GroupRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.GroupRealm;
|
||||
|
||||
import io.realm.Case;
|
||||
import io.realm.Realm;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.GroupRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.GroupRealm;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmQuery;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmQuery;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmQuery;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmObject;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 11/01/2017.
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.data.repository.specifications;
|
||||
package de.beyondsoft.ownchat.data.repository.specifications;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.UserRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.UserRealm;
|
||||
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmQuery;
|
||||
@@ -1,21 +1,21 @@
|
||||
package com.p3.bewoplaner.di;
|
||||
package de.beyondsoft.ownchat.di;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.p3.bewoplaner.BewoplanerApplication;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.api.ApiModule;
|
||||
import com.p3.bewoplaner.data.prefs.AppPrefs;
|
||||
import com.p3.bewoplaner.data.prefs.AppPrefsModule;
|
||||
import com.p3.bewoplaner.data.prefs.BooleanPreference;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.data.prefs.StringPreference;
|
||||
import com.p3.bewoplaner.data.repository.GroupRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.MessageRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.RealmProvider;
|
||||
import com.p3.bewoplaner.data.repository.RepositoryModule;
|
||||
import com.p3.bewoplaner.data.repository.UserRealmRepository;
|
||||
import com.p3.bewoplaner.di.scopes.ApplicationScope;
|
||||
import com.p3.bewoplaner.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.BewoplanerApplication;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.api.ApiModule;
|
||||
import de.beyondsoft.ownchat.data.prefs.AppPrefs;
|
||||
import de.beyondsoft.ownchat.data.prefs.AppPrefsModule;
|
||||
import de.beyondsoft.ownchat.data.prefs.BooleanPreference;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.data.prefs.StringPreference;
|
||||
import de.beyondsoft.ownchat.data.repository.GroupRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.MessageRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.RealmProvider;
|
||||
import de.beyondsoft.ownchat.data.repository.RepositoryModule;
|
||||
import de.beyondsoft.ownchat.data.repository.UserRealmRepository;
|
||||
import de.beyondsoft.ownchat.di.scopes.ApplicationScope;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import com.securepreferences.SecurePreferences;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
@@ -38,9 +38,6 @@ public interface ApplicationComponent {
|
||||
@P3DSEndpoint
|
||||
Retrofit provideP3DSRetrofit();
|
||||
|
||||
@VoucherEndpoint
|
||||
Retrofit provideVoucherRetrofit();
|
||||
|
||||
SystemUtils provideSystemUtils();
|
||||
|
||||
@AppPrefs
|
||||
@@ -79,6 +76,15 @@ public interface ApplicationComponent {
|
||||
@Named(AppPrefsConstants.APP_KILLED)
|
||||
BooleanPreference provideAppKilled();
|
||||
|
||||
@Named(AppPrefsConstants.UPLOAD_MAX_SIZE)
|
||||
LongPreference provideUploadMaxSize();
|
||||
|
||||
@Named(AppPrefsConstants.IS_EMPLOYEE)
|
||||
BooleanPreference provideIsEmployee();
|
||||
|
||||
@Named(AppPrefsConstants.SHOW_LOGIN_AGAIN)
|
||||
BooleanPreference provideShowLoginAgain();
|
||||
|
||||
NotificationManager provideNotificationManager();
|
||||
|
||||
GroupRealmRepository provideGroupRealmRepository();
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.di;
|
||||
package de.beyondsoft.ownchat.di;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.p3.bewoplaner.BewoplanerApplication;
|
||||
import com.p3.bewoplaner.di.scopes.ApplicationScope;
|
||||
import com.p3.bewoplaner.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.BewoplanerApplication;
|
||||
import de.beyondsoft.ownchat.di.scopes.ApplicationScope;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
@@ -1,20 +1,22 @@
|
||||
package com.p3.bewoplaner.di;
|
||||
package de.beyondsoft.ownchat.di;
|
||||
|
||||
import com.p3.bewoplaner.BewoplanerApplication;
|
||||
import com.p3.bewoplaner.data.firebase.DaggerMessagingComponent;
|
||||
import com.p3.bewoplaner.data.firebase.MessagingComponent;
|
||||
import com.p3.bewoplaner.page.chat.ChatComponent;
|
||||
import com.p3.bewoplaner.page.chat.DaggerChatComponent;
|
||||
import com.p3.bewoplaner.page.contacts.ContactsComponent;
|
||||
import com.p3.bewoplaner.page.contacts.DaggerContactsComponent;
|
||||
import com.p3.bewoplaner.page.login.DaggerLoginComponent;
|
||||
import com.p3.bewoplaner.page.login.LoginComponent;
|
||||
import com.p3.bewoplaner.page.main.DaggerMainComponent;
|
||||
import com.p3.bewoplaner.page.main.MainComponent;
|
||||
import com.p3.bewoplaner.page.profile.DaggerProfileComponent;
|
||||
import com.p3.bewoplaner.page.profile.ProfileComponent;
|
||||
import com.p3.bewoplaner.page.splash.DaggerSplashComponent;
|
||||
import com.p3.bewoplaner.page.splash.SplashComponent;
|
||||
import de.beyondsoft.ownchat.BewoplanerApplication;
|
||||
import de.beyondsoft.ownchat.data.firebase.DaggerMessagingComponent;
|
||||
import de.beyondsoft.ownchat.data.firebase.MessagingComponent;
|
||||
import de.beyondsoft.ownchat.page.chat.ChatComponent;
|
||||
import de.beyondsoft.ownchat.page.chat.DaggerChatComponent;
|
||||
import de.beyondsoft.ownchat.page.contacts.ContactsComponent;
|
||||
import de.beyondsoft.ownchat.page.contacts.DaggerContactsComponent;
|
||||
import de.beyondsoft.ownchat.page.fileconfirmation.DaggerFileConfirmationComponent;
|
||||
import de.beyondsoft.ownchat.page.fileconfirmation.FileConfirmationComponent;
|
||||
import de.beyondsoft.ownchat.page.login.DaggerLoginComponent;
|
||||
import de.beyondsoft.ownchat.page.login.LoginComponent;
|
||||
import de.beyondsoft.ownchat.page.main.DaggerMainComponent;
|
||||
import de.beyondsoft.ownchat.page.main.MainComponent;
|
||||
import de.beyondsoft.ownchat.page.profile.DaggerProfileComponent;
|
||||
import de.beyondsoft.ownchat.page.profile.ProfileComponent;
|
||||
import de.beyondsoft.ownchat.page.splash.DaggerSplashComponent;
|
||||
import de.beyondsoft.ownchat.page.splash.SplashComponent;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -30,6 +32,7 @@ public class InjectionHelper {
|
||||
private static MessagingComponent sMessagingComponent;
|
||||
private static ChatComponent sChatComponent;
|
||||
private static ProfileComponent sProfileComponent;
|
||||
private static FileConfirmationComponent sFileConfirmationComponent;
|
||||
|
||||
public static ApplicationComponent getApplicationComponent(Context context) {
|
||||
return ((BewoplanerApplication) context.getApplicationContext()).getApplicationComponent();
|
||||
@@ -41,6 +44,7 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sSplashComponent;
|
||||
}
|
||||
|
||||
@@ -50,6 +54,7 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sLoginComponent;
|
||||
}
|
||||
|
||||
@@ -59,6 +64,7 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sMainComponent;
|
||||
}
|
||||
|
||||
@@ -68,6 +74,7 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sContactsComponent;
|
||||
}
|
||||
|
||||
@@ -77,6 +84,7 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sMessagingComponent;
|
||||
}
|
||||
|
||||
@@ -86,6 +94,7 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sProfileComponent;
|
||||
}
|
||||
|
||||
@@ -95,9 +104,20 @@ public class InjectionHelper {
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sChatComponent;
|
||||
}
|
||||
|
||||
public static FileConfirmationComponent getFileConfirmationComponent(Context context) {
|
||||
if(sFileConfirmationComponent == null) {
|
||||
sFileConfirmationComponent = DaggerFileConfirmationComponent.builder()
|
||||
.applicationComponent(getApplicationComponent(context))
|
||||
.build();
|
||||
}
|
||||
|
||||
return sFileConfirmationComponent;
|
||||
}
|
||||
|
||||
public static void destroySplashComponent() {
|
||||
sSplashComponent = null;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.di;
|
||||
package de.beyondsoft.ownchat.di;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.di.scopes;
|
||||
package de.beyondsoft.ownchat.di.scopes;
|
||||
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.di.scopes;
|
||||
package de.beyondsoft.ownchat.di.scopes;
|
||||
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.p3.bewoplaner.model;
|
||||
package de.beyondsoft.ownchat.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.GroupRealm;
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import com.p3.bewoplaner.data.repository.models.UserRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.GroupRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.UserRealm;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.model;
|
||||
package de.beyondsoft.ownchat.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.model;
|
||||
package de.beyondsoft.ownchat.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import com.p3.bewoplaner.data.repository.models.UserRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.models.UserRealm;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -84,6 +84,7 @@ public class User implements Parcelable {
|
||||
if (userRealm == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new User(userRealm.getId(), userRealm.getFirstName(), userRealm.getLastName(),
|
||||
userRealm.getAvatar(), userRealm.getMobile(), userRealm.isEmployee());
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.model.common;
|
||||
package de.beyondsoft.ownchat.model.common;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@@ -35,5 +35,13 @@ public class BaseResponse {
|
||||
@SerializedName("token")
|
||||
public String token;
|
||||
|
||||
@SerializedName("chatcode_inactive")
|
||||
public List<String> chatCodeInactive;
|
||||
|
||||
@SerializedName("chatcode_failed")
|
||||
public List<String> chatCodeFailed;
|
||||
|
||||
@SerializedName("chatcode")
|
||||
public List<String> chatCodeTooShort;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.events.InvalidTokenEvent;
|
||||
import com.p3.bewoplaner.data.events.LogoutDirectlyEvent;
|
||||
import com.p3.bewoplaner.data.prefs.BooleanPreference;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.di.InjectionHelper;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.common.RuntimePermissionActivity;
|
||||
import com.p3.bewoplaner.page.login.LoginPresenter;
|
||||
import com.p3.bewoplaner.page.main.LogoutNavigation;
|
||||
import com.p3.bewoplaner.utils.EndlessScrollListener;
|
||||
import com.p3.bewoplaner.utils.FileUtils;
|
||||
import com.p3.bewoplaner.utils.SystemUtils;
|
||||
import com.p3.bewoplaner.utils.ui.EmptyLayout;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.events.InvalidTokenEvent;
|
||||
import de.beyondsoft.ownchat.data.events.LogoutDirectlyEvent;
|
||||
import de.beyondsoft.ownchat.data.prefs.BooleanPreference;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.common.RuntimePermissionActivity;
|
||||
import de.beyondsoft.ownchat.page.login.LoginPresenter;
|
||||
import de.beyondsoft.ownchat.page.main.LogoutNavigation;
|
||||
import de.beyondsoft.ownchat.utils.EndlessScrollListener;
|
||||
import de.beyondsoft.ownchat.utils.FileUtils;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.ui.EmptyLayout;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -62,8 +62,6 @@ import hani.momanii.supernova_emoji_library.Actions.EmojIconActions;
|
||||
import hani.momanii.supernova_emoji_library.Helper.EmojiconEditText;
|
||||
import okhttp3.MediaType;
|
||||
|
||||
import static com.p3.bewoplaner.data.AppPrefsConstants.USER_ID;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 21/02/2017.
|
||||
*/
|
||||
@@ -109,7 +107,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
CoordinatorLayout mCoordinatorLayout;
|
||||
|
||||
@Inject
|
||||
@Named(USER_ID)
|
||||
@Named(AppPrefsConstants.USER_ID)
|
||||
LongPreference mUserIdPreference;
|
||||
|
||||
@Inject
|
||||
@@ -253,7 +251,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
@OnClick(R.id.chat_send_message)
|
||||
void messageSent() {
|
||||
mLoginPresenter.checkIfVoucherStillAvailable(this);
|
||||
// mLoginPresenter.checkIfVoucherStillAvailable(this);
|
||||
mCallback.sendMessage(mChatMessageEmojiEditText.getText().toString());
|
||||
mChatMessageEmojiEditText.setText("");
|
||||
}
|
||||
@@ -265,22 +263,24 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
private void selectFile(int requestCode) {
|
||||
Intent intent;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
|
||||
} else {
|
||||
intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
}
|
||||
|
||||
intent.setType("*/*");
|
||||
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
|
||||
startActivityForResult(Intent.createChooser(intent, getResources().getString(R.string.chat_select_file)), SELECT_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mLoginPresenter.checkIfVoucherStillAvailable(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -316,14 +316,22 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
mChatPresenter.attachView(this);
|
||||
}
|
||||
|
||||
// Show preview for images/gifs and maybe videos
|
||||
// TODO: Show preview for images/gifs and maybe videos
|
||||
|
||||
/*Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.FILENAME, uri.toString());
|
||||
|
||||
Intent intent = new Intent(this, FileConfirmationActivity.class);
|
||||
intent.putExtras(bundle);
|
||||
|
||||
startActivityForResult(intent, 666);*/
|
||||
|
||||
mCallback.sendFile(uri);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logoutDirectly() {
|
||||
public void logoutDirectly(boolean clearAllPrefs) {
|
||||
EventBus.getDefault().post(new LogoutDirectlyEvent());
|
||||
finish();
|
||||
}
|
||||
@@ -359,10 +367,10 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
@Override
|
||||
public void resendMessage(Message message) {
|
||||
mLoginPresenter.checkIfVoucherStillAvailable(this);
|
||||
if (!mChatPresenter.isAttached()) {
|
||||
mChatPresenter.attachView(this);
|
||||
}
|
||||
|
||||
mCallback.resendMessage(message);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.github.lzyzsd.circleprogress.DonutProgress;
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.utils.DateUtils;
|
||||
import com.p3.bewoplaner.utils.ui.ViewUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.utils.DateUtils;
|
||||
import de.beyondsoft.ownchat.utils.ui.ViewUtils;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.Nullable;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.di.ApplicationComponent;
|
||||
import com.p3.bewoplaner.di.scopes.ActivityScope;
|
||||
import com.p3.bewoplaner.page.login.LoginModule;
|
||||
import de.beyondsoft.ownchat.di.ApplicationComponent;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
import de.beyondsoft.ownchat.page.login.LoginModule;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.data.api.services.ChatService;
|
||||
import com.p3.bewoplaner.di.P3DSEndpoint;
|
||||
import com.p3.bewoplaner.di.scopes.ActivityScope;
|
||||
import de.beyondsoft.ownchat.data.api.services.ChatService;
|
||||
import de.beyondsoft.ownchat.di.P3DSEndpoint;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
@@ -1,27 +1,27 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.api.common.ErrorHandlingResponseConverter;
|
||||
import com.p3.bewoplaner.data.api.responses.MessageResponse;
|
||||
import com.p3.bewoplaner.data.api.responses.MessagesResponse;
|
||||
import com.p3.bewoplaner.data.api.services.ChatService;
|
||||
import com.p3.bewoplaner.data.events.GroupUpdatedEvent;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.data.prefs.StringPreference;
|
||||
import com.p3.bewoplaner.data.repository.GroupRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.MessageRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.RealmProvider;
|
||||
import com.p3.bewoplaner.data.repository.models.MessageRealm;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupByIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.MessageByGroupIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.MessageByIdSpecification;
|
||||
import com.p3.bewoplaner.di.scopes.ActivityScope;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.mvp.MVPAbstractPresenter;
|
||||
import com.p3.bewoplaner.utils.SystemUtils;
|
||||
import com.p3.bewoplaner.utils.rx.RxUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.api.common.ErrorHandlingResponseConverter;
|
||||
import de.beyondsoft.ownchat.data.api.responses.MessageResponse;
|
||||
import de.beyondsoft.ownchat.data.api.responses.MessagesResponse;
|
||||
import de.beyondsoft.ownchat.data.api.services.ChatService;
|
||||
import de.beyondsoft.ownchat.data.events.GroupUpdatedEvent;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.data.prefs.StringPreference;
|
||||
import de.beyondsoft.ownchat.data.repository.GroupRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.MessageRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.RealmProvider;
|
||||
import de.beyondsoft.ownchat.data.repository.models.MessageRealm;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupByIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.MessageByGroupIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.MessageByIdSpecification;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPAbstractPresenter;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.rx.RxUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -45,6 +45,7 @@ import java.util.Random;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import de.beyondsoft.ownchat.utils.FileUtils;
|
||||
import io.realm.Realm;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
@@ -56,15 +57,13 @@ import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.functions.Func1;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
import static com.p3.bewoplaner.data.AppPrefsConstants.USER_ID;
|
||||
import static com.p3.bewoplaner.utils.FileUtils.getFileTypeFromFilePath;
|
||||
import static de.beyondsoft.ownchat.data.AppPrefsConstants.USER_ID;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 21/02/2017.
|
||||
*/
|
||||
@ActivityScope
|
||||
public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
implements ChatView.Callback {
|
||||
public class ChatPresenter extends MVPAbstractPresenter<ChatView> implements ChatView.Callback {
|
||||
|
||||
private static final int FIRST_PAGE = 1;
|
||||
private static final int GROUP_ID_NOT_SET = -999;
|
||||
@@ -154,33 +153,43 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
if (messageResponse.response.messages == null || messageResponse.response.messages.isEmpty()) {
|
||||
return Observable.just(null);
|
||||
}
|
||||
|
||||
Message lastMessage = messageResponse.response.messages.get(messageResponse.response.messages.size() - 1);
|
||||
lastMessage.status = Message.Status.DELIVERED;
|
||||
lastMessage.isRead = true;
|
||||
|
||||
if (!mMessages.contains(lastMessage)) {
|
||||
long groupId = mGroupId;
|
||||
resetMessages();
|
||||
loadMessagesFromServerByGroupId(groupId);
|
||||
|
||||
return Observable.just(null);
|
||||
}
|
||||
|
||||
for (int i = 0; i < mMessageToUpdate.size(); i++) {
|
||||
Pair<Message, String> messageToUpdate = mMessageToUpdate.get(i);
|
||||
|
||||
if (isAttached()) {
|
||||
getView().lastMessageUpdated(messageToUpdate.first, messageToUpdate.second);
|
||||
}
|
||||
}
|
||||
|
||||
mMessageToUpdate.clear();
|
||||
ArrayList<Message> messages = new ArrayList<>();
|
||||
|
||||
for (int i = messageResponse.response.messages.size() - 1; i >= 0; i--) {
|
||||
Message message = messageResponse.response.messages.get(i);
|
||||
message.status = Message.Status.DELIVERED;
|
||||
message.isRead = true;
|
||||
message.userId = mUserIdPreference.get();
|
||||
|
||||
if (mMessages.contains(message)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
messages.add(message);
|
||||
}
|
||||
|
||||
return mMessageRealmRepository.updateMessages(messages, new MessageByIdSpecification(mUserIdPreference.get()));
|
||||
}
|
||||
})
|
||||
@@ -257,10 +266,12 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
Log.e(ChatPresenter.class.getSimpleName(), throwable.getMessage(), throwable);
|
||||
getView().hideLoading();
|
||||
getView().hideMessagesLoading();
|
||||
|
||||
if (mSystemUtils.isNetworkUnavailable()) {
|
||||
getView().showError(R.string.error_no_internet_connection);
|
||||
return;
|
||||
}
|
||||
|
||||
getView().showError(R.string.error_something_went_wrong);
|
||||
}
|
||||
|
||||
@@ -371,10 +382,12 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
@Override
|
||||
public void sendFile(Uri fileUri) {
|
||||
File file = getView().getFile(fileUri);
|
||||
|
||||
if (file == null || !file.exists()) {
|
||||
getView().showToastMessage(R.string.error_file_not_found);
|
||||
return;
|
||||
}
|
||||
|
||||
String[] split = file.getAbsolutePath().split("/");
|
||||
|
||||
Message message = new Message(findUniqueRandomId(mRealmProvider, mUserIdPreference.get()),
|
||||
@@ -393,8 +406,7 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
mUserIdPreference.get(),
|
||||
false);
|
||||
|
||||
storeMessageLocally(message)
|
||||
.subscribe(new Subscriber<Object>() {
|
||||
storeMessageLocally(message).subscribe(new Subscriber<Object>() {
|
||||
@Override
|
||||
public void onCompleted() {
|
||||
if (mSystemUtils.isNetworkUnavailable()) {
|
||||
@@ -481,7 +493,7 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
public void downloadFile(Message message, String filePath, int itemPosition) {
|
||||
if (message.fileDownloaded) {
|
||||
getView().stopItemProgress(itemPosition);
|
||||
getView().fileDownloadedSuccessfully(filePath, getFileTypeFromFilePath(filePath));
|
||||
getView().fileDownloadedSuccessfully(filePath, FileUtils.getFileTypeFromFilePath(filePath));
|
||||
return;
|
||||
}
|
||||
downloadFileFromUrl(message.filePath, filePath, itemPosition)
|
||||
@@ -911,7 +923,7 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
int totalSize = urlConnection.getContentLength();
|
||||
|
||||
if (file.length() == totalSize || totalSize == -1) {
|
||||
subscriber.onNext(getFileTypeFromFilePath(filePath));
|
||||
subscriber.onNext(FileUtils.getFileTypeFromFilePath(filePath));
|
||||
subscriber.onCompleted();
|
||||
return;
|
||||
}
|
||||
@@ -946,7 +958,7 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView>
|
||||
//close the output stream when done
|
||||
fileOutput.close();
|
||||
|
||||
subscriber.onNext(getFileTypeFromFilePath(filePath));
|
||||
subscriber.onNext(FileUtils.getFileTypeFromFilePath(filePath));
|
||||
subscriber.onCompleted();
|
||||
|
||||
} catch (IOException e) {
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.mvp.MVPView;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPView;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.StringRes;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.chatmembers.ChatMembersActivity;
|
||||
import com.p3.bewoplaner.utils.Constants;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.chatmembers.ChatMembersActivity;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.utils.DateUtils;
|
||||
import com.p3.bewoplaner.utils.ui.ViewUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.utils.DateUtils;
|
||||
import de.beyondsoft.ownchat.utils.ui.ViewUtils;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Gravity;
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.utils.Constants;
|
||||
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -48,7 +48,7 @@ public class SingleChatActivity extends BaseChatActivity {
|
||||
|
||||
if (mSystemUtils.isNetworkUnavailable()) {
|
||||
mCallback.loadMessagesFromDBByGroupId(mGroup.id, true);
|
||||
showError(R.string.error_no_internet_connection);
|
||||
showError(de.beyondsoft.ownchat.R.string.error_no_internet_connection);
|
||||
} else {
|
||||
mCallback.loadMessagesFromServerByGroupId(mGroup.id);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class SingleChatActivity extends BaseChatActivity {
|
||||
|
||||
if (mSystemUtils.isNetworkUnavailable()) {
|
||||
mCallback.loadMessagesFromDBByGroupId(mGroup.id, true);
|
||||
showError(R.string.error_no_internet_connection);
|
||||
showError(de.beyondsoft.ownchat.R.string.error_no_internet_connection);
|
||||
} else {
|
||||
mCallback.fetchNewMessages(mGroup.id);
|
||||
}
|
||||
@@ -89,12 +89,12 @@ public class SingleChatActivity extends BaseChatActivity {
|
||||
protected void loadMessages() {
|
||||
if (!TextUtils.isEmpty(mGroup.mobile)) {
|
||||
mExtraImageView.setVisibility(View.VISIBLE);
|
||||
mExtraImageView.setImageResource(R.drawable.call);
|
||||
mExtraImageView.setImageResource(de.beyondsoft.ownchat.R.drawable.call);
|
||||
}
|
||||
|
||||
if (mSystemUtils.isNetworkUnavailable()) {
|
||||
mCallback.loadMessagesFromDBByGroupId(mGroup.id, true);
|
||||
showError(R.string.error_no_internet_connection);
|
||||
showError(de.beyondsoft.ownchat.R.string.error_no_internet_connection);
|
||||
} else {
|
||||
mCallback.loadMessagesFromServerByGroupId(mGroup.id);
|
||||
}
|
||||
@@ -104,13 +104,13 @@ public class SingleChatActivity extends BaseChatActivity {
|
||||
protected void setToolbar() {
|
||||
mSingleChatTitleTextView.setVisibility(View.VISIBLE);
|
||||
mSingleChatTitleTextView.setText(mGroup.name);
|
||||
mSingleChatTitleTextView.setTextColor(ContextCompat.getColor(this, mGroup.isEmployee(mGroup.users) ? R.color.colorHelpGroup : R.color.colorBlack));
|
||||
mSingleChatTitleTextView.setTextColor(ContextCompat.getColor(this, mGroup.isEmployee(mGroup.users) ? de.beyondsoft.ownchat.R.color.colorHelpGroup : de.beyondsoft.ownchat.R.color.colorBlack));
|
||||
|
||||
if (TextUtils.isEmpty(mGroup.avatar)) {
|
||||
mChatImageView.setImageResource(R.drawable.avatar);
|
||||
mChatImageView.setImageResource(de.beyondsoft.ownchat.R.drawable.avatar);
|
||||
} else {
|
||||
Glide.with(this).load(mGroup.avatar)
|
||||
.placeholder(R.drawable.avatar)
|
||||
.placeholder(de.beyondsoft.ownchat.R.drawable.avatar)
|
||||
.dontAnimate()
|
||||
.into(mChatImageView);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.page.chat;
|
||||
package de.beyondsoft.ownchat.page.chat;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.utils.DateUtils;
|
||||
import com.p3.bewoplaner.utils.ui.ViewUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.utils.DateUtils;
|
||||
import de.beyondsoft.ownchat.utils.ui.ViewUtils;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Gravity;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.page.chatmembers;
|
||||
package de.beyondsoft.ownchat.page.chatmembers;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.utils.ui.HorizontalDividerItemDecoration;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.utils.ui.HorizontalDividerItemDecoration;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -57,8 +57,7 @@ public class ChatMembersActivity extends AppCompatActivity {
|
||||
Group group = getIntent().getParcelableExtra(GROUP_ARG);
|
||||
setToolbar(group);
|
||||
|
||||
mHorizontalDividerItemDecoration = new HorizontalDividerItemDecoration.Builder(this)
|
||||
.colorResId(R.color.colorFill).build();
|
||||
mHorizontalDividerItemDecoration = new HorizontalDividerItemDecoration.Builder(this).colorResId(R.color.colorFill).build();
|
||||
mChatMembersRecyclerView.addItemDecoration(mHorizontalDividerItemDecoration);
|
||||
mChatMembersRecyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
@@ -70,11 +69,9 @@ public class ChatMembersActivity extends AppCompatActivity {
|
||||
mGroupTitleTextView.setVisibility(View.VISIBLE);
|
||||
mGroupMembersTextView.setVisibility(View.GONE);
|
||||
mExtraImageView.setVisibility(View.GONE);
|
||||
mChatImageView.setImageResource(group.isHelpGroup() ? R.drawable.avatar_help_group
|
||||
: R.drawable.avatar_team_group);
|
||||
mChatImageView.setImageResource(group.isHelpGroup() ? R.drawable.avatar_help_group : R.drawable.avatar_team_group);
|
||||
mGroupTitleTextView.setText(group.name);
|
||||
mGroupTitleTextView.setTextColor(ContextCompat.getColor(this,
|
||||
group.isHelpGroup() ? R.color.colorHelpGroup : R.color.colorTeamGroup));
|
||||
mGroupTitleTextView.setTextColor(ContextCompat.getColor(this, group.isHelpGroup() ? R.color.colorHelpGroup : R.color.colorTeamGroup));
|
||||
}
|
||||
|
||||
@OnClick(R.id.chat_toolbar_back_arrow)
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.p3.bewoplaner.page.chatmembers;
|
||||
package de.beyondsoft.ownchat.page.chatmembers;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.User;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.User;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.page.common;
|
||||
package de.beyondsoft.ownchat.page.common;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
|
||||
@@ -14,9 +14,11 @@ public class BaseFragment extends Fragment {
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
if (mUnbinder == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mUnbinder.unbind();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.p3.bewoplaner.page.common;
|
||||
package de.beyondsoft.ownchat.page.common;
|
||||
|
||||
/**
|
||||
* Callback for requesting permission.
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.p3.bewoplaner.page.common;
|
||||
package de.beyondsoft.ownchat.page.common;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.utils.DialogHandler;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.utils.DialogHandler;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.p3.bewoplaner.page.contacts;
|
||||
package de.beyondsoft.ownchat.page.contacts;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.utils.DateUtils;
|
||||
import com.p3.bewoplaner.utils.ui.ViewUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.utils.DateUtils;
|
||||
import de.beyondsoft.ownchat.utils.ui.ViewUtils;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.page.contacts;
|
||||
package de.beyondsoft.ownchat.page.contacts;
|
||||
|
||||
import com.p3.bewoplaner.di.ApplicationComponent;
|
||||
import com.p3.bewoplaner.di.scopes.ActivityScope;
|
||||
import com.p3.bewoplaner.page.chat.ChatModule;
|
||||
import de.beyondsoft.ownchat.di.ApplicationComponent;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
import de.beyondsoft.ownchat.page.chat.ChatModule;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.p3.bewoplaner.page.contacts;
|
||||
package de.beyondsoft.ownchat.page.contacts;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.events.GroupUpdatedEvent;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.di.InjectionHelper;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.chat.GroupChatActivity;
|
||||
import com.p3.bewoplaner.page.chat.SingleChatActivity;
|
||||
import com.p3.bewoplaner.page.common.BaseFragment;
|
||||
import com.p3.bewoplaner.utils.Constants;
|
||||
import com.p3.bewoplaner.utils.ui.EmptyLayout;
|
||||
import com.p3.bewoplaner.utils.ui.HorizontalDividerItemDecoration;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.events.GroupUpdatedEvent;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.chat.GroupChatActivity;
|
||||
import de.beyondsoft.ownchat.page.chat.SingleChatActivity;
|
||||
import de.beyondsoft.ownchat.page.common.BaseFragment;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
import de.beyondsoft.ownchat.utils.ui.EmptyLayout;
|
||||
import de.beyondsoft.ownchat.utils.ui.HorizontalDividerItemDecoration;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -1,22 +1,22 @@
|
||||
package com.p3.bewoplaner.page.contacts;
|
||||
package de.beyondsoft.ownchat.page.contacts;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import com.p3.bewoplaner.data.AppPrefsConstants;
|
||||
import com.p3.bewoplaner.data.api.common.ErrorHandlingResponseConverter;
|
||||
import com.p3.bewoplaner.data.api.responses.GroupResponse;
|
||||
import com.p3.bewoplaner.data.api.services.ChatService;
|
||||
import com.p3.bewoplaner.data.prefs.LongPreference;
|
||||
import com.p3.bewoplaner.data.repository.GroupRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.UserRealmRepository;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupByIdSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupByNameSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.GroupSpecification;
|
||||
import com.p3.bewoplaner.data.repository.specifications.UserByIdSpecification;
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.mvp.MVPAbstractPresenter;
|
||||
import com.p3.bewoplaner.utils.SystemUtils;
|
||||
import com.p3.bewoplaner.utils.rx.RxUtils;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.data.AppPrefsConstants;
|
||||
import de.beyondsoft.ownchat.data.api.common.ErrorHandlingResponseConverter;
|
||||
import de.beyondsoft.ownchat.data.api.responses.GroupResponse;
|
||||
import de.beyondsoft.ownchat.data.api.services.ChatService;
|
||||
import de.beyondsoft.ownchat.data.prefs.LongPreference;
|
||||
import de.beyondsoft.ownchat.data.repository.GroupRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.UserRealmRepository;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupByIdSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupByNameSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.GroupSpecification;
|
||||
import de.beyondsoft.ownchat.data.repository.specifications.UserByIdSpecification;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPAbstractPresenter;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.rx.RxUtils;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.p3.bewoplaner.page.contacts;
|
||||
package de.beyondsoft.ownchat.page.contacts;
|
||||
|
||||
import com.p3.bewoplaner.model.Group;
|
||||
import com.p3.bewoplaner.model.Message;
|
||||
import com.p3.bewoplaner.page.mvp.MVPView;
|
||||
import de.beyondsoft.ownchat.model.Group;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPView;
|
||||
|
||||
import android.support.annotation.StringRes;
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package de.beyondsoft.ownchat.page.fileconfirmation;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.di.InjectionHelper;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
import de.beyondsoft.ownchat.utils.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import hani.momanii.supernova_emoji_library.Helper.EmojiconEditText;
|
||||
|
||||
public class FileConfirmationActivity extends AppCompatActivity implements FileConfirmationView {
|
||||
|
||||
@BindView(R.id.file_message)
|
||||
EmojiconEditText mMessageEmojiconEditText;
|
||||
|
||||
@BindView(R.id.file_emoji_button)
|
||||
ImageView mEmojiButtonImageView;
|
||||
|
||||
@BindView(R.id.media_file_webview)
|
||||
WebView mFileWebView;
|
||||
|
||||
@BindView(R.id.file_send_message)
|
||||
ImageView mSendMessageButtonImageView;
|
||||
|
||||
|
||||
@Inject
|
||||
FileConfirmationPresenter mFileConfirmationPresenter;
|
||||
|
||||
private Callback mCallback;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_file_confirmation);
|
||||
|
||||
InjectionHelper.getFileConfirmationComponent(this).inject(this);
|
||||
ButterKnife.bind(this);
|
||||
mFileConfirmationPresenter.attachView(this);
|
||||
|
||||
String fileUri = getIntent().getStringExtra(Constants.FILENAME);
|
||||
|
||||
File file = getFile(Uri.parse(fileUri));
|
||||
String absolutePath = file.getAbsolutePath();
|
||||
|
||||
String html = "<html><head></head><body><img src=\""+ absolutePath + "\"></body></html>";
|
||||
try {
|
||||
mFileWebView.loadDataWithBaseURL("", html, "text/html", "utf-8", null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private String getPath(Uri uri) {
|
||||
String[] projection = {MediaStore.Images.Media.DATA};
|
||||
Cursor cursor = getContentResolver().query(uri, projection, null, null, null);
|
||||
|
||||
if(cursor == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
cursor.moveToFirst();
|
||||
String path = cursor.getString(columnIndex);
|
||||
cursor.close();
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFileSuccessful() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCallback(Callback callback) {
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
InjectionHelper.destroyLoginComponent();
|
||||
mFileConfirmationPresenter.detachView();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoading() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showContent() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showError(@StringRes int messageRes) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showError(String message) {
|
||||
|
||||
}
|
||||
|
||||
public File getFile(Uri fileUri) {
|
||||
return FileUtils.getFile(this, fileUri);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package de.beyondsoft.ownchat.page.fileconfirmation;
|
||||
|
||||
import de.beyondsoft.ownchat.di.ApplicationComponent;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
/**
|
||||
* Created by Lyndon on 13-Oct-2017.
|
||||
*/
|
||||
|
||||
@ActivityScope
|
||||
@Component(dependencies = ApplicationComponent.class, modules = FileConfirmationModule.class)
|
||||
public interface FileConfirmationComponent {
|
||||
void inject(FileConfirmationActivity fileConfirmationActivity);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package de.beyondsoft.ownchat.page.fileconfirmation;
|
||||
|
||||
import de.beyondsoft.ownchat.data.api.services.ChatService;
|
||||
import de.beyondsoft.ownchat.di.P3DSEndpoint;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
/**
|
||||
* Created by Lyndon on 13-Oct-2017.
|
||||
*/
|
||||
|
||||
@Module
|
||||
public class FileConfirmationModule {
|
||||
@Provides
|
||||
@ActivityScope
|
||||
ChatService provideChatService(@P3DSEndpoint Retrofit retrofit) {
|
||||
return retrofit.create(ChatService.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package de.beyondsoft.ownchat.page.fileconfirmation;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import de.beyondsoft.ownchat.data.api.services.ChatService;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPAbstractPresenter;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Created by Lyndon on 13-Oct-2017.
|
||||
*/
|
||||
|
||||
public class FileConfirmationPresenter extends MVPAbstractPresenter<FileConfirmationView> implements FileConfirmationView.Callback {
|
||||
|
||||
@Inject
|
||||
ChatService mChatService;
|
||||
|
||||
@Inject
|
||||
Context mContext;
|
||||
|
||||
@Inject
|
||||
FileConfirmationPresenter() {}
|
||||
|
||||
@Override
|
||||
protected void afterAttachView(@NonNull FileConfirmationView view) {
|
||||
super.afterAttachView(view);
|
||||
view.setCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeDetachView(@NonNull FileConfirmationView view) {
|
||||
view.setCallback(null);
|
||||
super.beforeDetachView(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFile(Uri fileUri) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package de.beyondsoft.ownchat.page.fileconfirmation;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPLceView;
|
||||
|
||||
/**
|
||||
* Created by Lyndon on 13-Oct-2017.
|
||||
*/
|
||||
|
||||
public interface FileConfirmationView extends MVPLceView {
|
||||
void sendFileSuccessful();
|
||||
|
||||
void setCallback(Callback callback);
|
||||
|
||||
interface Callback {
|
||||
void sendFile(Uri fileUri);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.p3.bewoplaner.page.impressum;
|
||||
package de.beyondsoft.ownchat.page.impressum;
|
||||
|
||||
import com.p3.bewoplaner.R;
|
||||
import de.beyondsoft.ownchat.R;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Intent;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user