.
This commit is contained in:
@@ -26,15 +26,15 @@ repositories {
|
||||
apply plugin: 'realm-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion '28.0.2'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "de.beyondsoft.ownchat"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 27
|
||||
versionCode 25
|
||||
versionName "1.25"
|
||||
targetSdkVersion 28
|
||||
versionCode 26
|
||||
versionName "1.26"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
}
|
||||
@@ -105,13 +105,13 @@ dependencies {
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
|
||||
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.7.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
|
||||
|
||||
implementation 'de.hdodenhof:circleimageview:2.1.0'
|
||||
implementation 'com.scottyab:secure-preferences-lib:0.1.4'
|
||||
implementation 'com.google.firebase:firebase-messaging:17.0.0'
|
||||
implementation 'com.google.firebase:firebase-core:16.0.1'
|
||||
implementation 'com.google.firebase:firebase-messaging:17.3.3'
|
||||
implementation 'com.google.firebase:firebase-core:16.0.4'
|
||||
implementation 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
|
||||
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
|
||||
implementation 'org.greenrobot:eventbus:3.0.0'
|
||||
@@ -121,7 +121,7 @@ dependencies {
|
||||
compileOnly 'javax.annotation:jsr250-api:1.0'
|
||||
implementation files('libs/sanselan-0_97-android-1.0.0.jar')
|
||||
implementation 'com.firebase:firebase-jobdispatcher:0.5.2'
|
||||
implementation 'com.google.android.gms:play-services-base:15.0.1'
|
||||
implementation 'com.google.android.gms:play-services-base:16.0.1'
|
||||
implementation files('libs/core-1.58.0.0.jar')
|
||||
implementation files('libs/prov-1.58.0.0.jar')
|
||||
implementation files('libs/bcpkix-jdk15on-1.58.0.0.jar')
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.android.internal.util.Predicate;
|
||||
import com.google.android.gms.common.util.Predicate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@@ -25,13 +25,7 @@ import de.beyondsoft.ownchat.filepicker.utils.MediaStoreHelper;
|
||||
import de.beyondsoft.ownchat.filepicker.utils.TabLayoutHelper;
|
||||
import de.beyondsoft.ownchat.filepicker.utils.FilePickerUtils;
|
||||
|
||||
/**
|
||||
* Created by Lyndon on 26-Oct-2017.
|
||||
*/
|
||||
|
||||
public class DocPickerFragment extends BaseFragment {
|
||||
private static final String TAG = DocPickerFragment.class.getSimpleName();
|
||||
|
||||
TabLayout tabLayout;
|
||||
|
||||
ViewPager viewPager;
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.android.internal.util.Predicate;
|
||||
import com.google.android.gms.common.util.Predicate;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -44,6 +44,7 @@ import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
@@ -89,7 +90,6 @@ import hani.momanii.supernova_emoji_library.Helper.EmojiconEditText;
|
||||
import okhttp3.MediaType;
|
||||
|
||||
abstract class BaseChatActivity extends RuntimePermissionActivity implements ChatView, BaseChatAdapter.MessageClickListener, LogoutNavigation, SearchView.OnQueryTextListener {
|
||||
|
||||
private final static int STORAGE_REQUEST_CODE = 9999;
|
||||
private final static int SELECT_IMAGE_FILE = 233;
|
||||
private final static int SELECT_DOC_FILE = 234;
|
||||
@@ -179,6 +179,11 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
protected boolean mIsInResultView = false;
|
||||
|
||||
|
||||
private Bundle mBundleRecyclerViewState;
|
||||
private final static String KEY_RECYCLER_STATE = "recycler_view_state";
|
||||
|
||||
|
||||
@Inject
|
||||
@Named(AppPrefsConstants.CHAT_OPENED)
|
||||
BooleanPreference mChatOpenedPref;
|
||||
@@ -207,9 +212,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
EmojIconActions emojiIcon = new EmojIconActions(this, mCoordinatorLayout, mChatMessageEmojiEditText, mEmojiButton);
|
||||
emojiIcon.ShowEmojIcon();
|
||||
|
||||
mChatMessageEmojiEditText.setOnClickListener(view -> {
|
||||
mCurrentVisibleItemPosition = ((LinearLayoutManager) mRecyclerView.getLayoutManager()).findFirstVisibleItemPosition();
|
||||
});
|
||||
mChatMessageEmojiEditText.setOnClickListener(view -> mCurrentVisibleItemPosition = ((LinearLayoutManager) mRecyclerView.getLayoutManager()).findFirstVisibleItemPosition());
|
||||
|
||||
showLoading();
|
||||
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
@@ -218,6 +221,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
private void setupRecyclerView() {
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
|
||||
linearLayoutManager.setStackFromEnd(true);
|
||||
linearLayoutManager.setReverseLayout(true);
|
||||
|
||||
@@ -724,7 +728,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
mChatPresenter.attachView(this);
|
||||
}
|
||||
|
||||
if(!mChatSearchView.isIconified()) {
|
||||
if(mIsInResultView) {
|
||||
jumpToMessage(message);
|
||||
|
||||
return;
|
||||
@@ -748,7 +752,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
@Override
|
||||
public void localFileClicked(Uri uri, Message message) {
|
||||
if(!mChatSearchView.isIconified()) {
|
||||
if(mIsInResultView) {
|
||||
jumpToMessage(message);
|
||||
|
||||
return;
|
||||
@@ -770,10 +774,12 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
private boolean mIsJumpingToMessage;
|
||||
@Override
|
||||
public void jumpToMessage(Message message) {
|
||||
if(mChatSearchView.isIconified()) {
|
||||
if(!mIsInResultView) {
|
||||
return;
|
||||
}
|
||||
|
||||
mIsInResultView = false;
|
||||
|
||||
if(!mChatPresenter.isAttached()) {
|
||||
mChatPresenter.attachView(this);
|
||||
}
|
||||
@@ -788,7 +794,7 @@ abstract class BaseChatActivity extends RuntimePermissionActivity implements Cha
|
||||
|
||||
mIsJumpingToMessage = true;
|
||||
|
||||
mRecyclerView.postDelayed(() -> mRecyclerView.smoothScrollToPosition(position), 50);
|
||||
mRecyclerView.postDelayed(() -> mRecyclerView.scrollToPosition(position), 50);
|
||||
} catch(Exception e) {
|
||||
Log.e("SCROLL_TO_MESSAGE", e.getMessage(), e);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import android.widget.TextView;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.github.lzyzsd.circleprogress.DonutProgress;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
@@ -31,7 +30,6 @@ import de.beyondsoft.ownchat.R;
|
||||
import de.beyondsoft.ownchat.model.DateItem;
|
||||
import de.beyondsoft.ownchat.model.Message;
|
||||
import de.beyondsoft.ownchat.model.RecyclerViewItem;
|
||||
import de.beyondsoft.ownchat.utils.BeyondSoftLog;
|
||||
import de.beyondsoft.ownchat.utils.DateUtils;
|
||||
import de.beyondsoft.ownchat.utils.Utils;
|
||||
import de.beyondsoft.ownchat.utils.ui.GlideApp;
|
||||
|
||||
@@ -6,9 +6,6 @@ import de.beyondsoft.ownchat.page.login.LoginModule;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
/**
|
||||
* Created by Rares Teodorescu on 21/02/2017.
|
||||
*/
|
||||
@ActivityScope
|
||||
@Component(dependencies = ApplicationComponent.class,
|
||||
modules = {LoginModule.class, ChatModule.class})
|
||||
|
||||
@@ -20,7 +20,6 @@ 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.BeyondSoftLog;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.Utils;
|
||||
@@ -41,13 +40,10 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -440,7 +436,6 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView> implements Cha
|
||||
mIndexLow = mOffset;
|
||||
mIndexHigh = endOffset;
|
||||
|
||||
BeyondSoftLog.logScrollingEvent_D("Calling messagesLoaded from loadMessagesInContextSuccessful");
|
||||
getView().messagesLoaded(new ArrayList<>(mMessages.subList(mOffset, endOffset)));
|
||||
|
||||
if(isFirstPage && mSystemUtils.isNetworkUnavailable()) {
|
||||
@@ -986,8 +981,6 @@ public class ChatPresenter extends MVPAbstractPresenter<ChatView> implements Cha
|
||||
}
|
||||
|
||||
private void storeMessageLocally(Message newMessage, String oldMessageId, boolean queryLocalDBWhenFinished) {
|
||||
BeyondSoftLog.logScrollingEvent_D("storeMessageLocally -> leads to loadMessagesFromDBByGroupId being called");
|
||||
|
||||
newMessage.userId = mUserIdPreference.get();
|
||||
MessageByIdSpecification messageByIdSpecification = new MessageByIdSpecification(mUserIdPreference.get());
|
||||
messageByIdSpecification.setMessageId(newMessage.id);
|
||||
|
||||
@@ -226,4 +226,6 @@ public class LoginActivity extends AppCompatActivity implements LoginView {
|
||||
mLoginPresenter.detachView();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.beyondsoft.ownchat.page.login;
|
||||
|
||||
import de.beyondsoft.ownchat.data.api.services.LoginService;
|
||||
import de.beyondsoft.ownchat.data.api.services.ProfileService;
|
||||
import de.beyondsoft.ownchat.data.api.services.RegisterService;
|
||||
import de.beyondsoft.ownchat.di.P3DSEndpoint;
|
||||
import de.beyondsoft.ownchat.di.scopes.ActivityScope;
|
||||
@@ -9,9 +10,6 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import retrofit2.Retrofit;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
@Module
|
||||
public class LoginModule {
|
||||
|
||||
@@ -26,4 +24,10 @@ public class LoginModule {
|
||||
RegisterService provideRegisterService(@P3DSEndpoint Retrofit retrofit) {
|
||||
return retrofit.create(RegisterService.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ActivityScope
|
||||
ProfileService provideProfileService(@P3DSEndpoint Retrofit retrofit) {
|
||||
return retrofit.create(ProfileService.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import de.beyondsoft.ownchat.data.api.common.ErrorType;
|
||||
import de.beyondsoft.ownchat.data.api.common.ErrorUtils;
|
||||
import de.beyondsoft.ownchat.data.api.responses.RegisterResponse;
|
||||
import de.beyondsoft.ownchat.data.api.services.LoginService;
|
||||
import de.beyondsoft.ownchat.data.api.services.ProfileService;
|
||||
import de.beyondsoft.ownchat.data.api.services.RegisterService;
|
||||
import de.beyondsoft.ownchat.data.prefs.AppPrefs;
|
||||
import de.beyondsoft.ownchat.data.prefs.BooleanPreference;
|
||||
@@ -25,6 +26,7 @@ import de.beyondsoft.ownchat.model.User;
|
||||
import de.beyondsoft.ownchat.page.main.LogoutNavigation;
|
||||
import de.beyondsoft.ownchat.page.main.MainNavigation;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPAbstractPresenter;
|
||||
import de.beyondsoft.ownchat.utils.BeyondSoftLog;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.rx.RxUtils;
|
||||
|
||||
@@ -59,6 +61,9 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
|
||||
@Inject
|
||||
LoginService mLoginService;
|
||||
|
||||
@Inject
|
||||
ProfileService mProfileService;
|
||||
|
||||
@Inject
|
||||
RegisterService mRegisterService;
|
||||
|
||||
@@ -310,9 +315,6 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
|
||||
|
||||
//region CheckTypeAndCustomerId
|
||||
|
||||
/**
|
||||
* Checks if the voucher necessary for login is correct.
|
||||
*/
|
||||
@Override
|
||||
public void checkTypeAndCustomerId(String customerId, String password, boolean isChecked) {
|
||||
mLastAccountNumberPreference.set(mAccountNumberPreference.get());
|
||||
@@ -427,9 +429,6 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
|
||||
|
||||
//region Logout
|
||||
|
||||
/**
|
||||
* Logout from application deletes all login preferences and redirects to login screen.
|
||||
*/
|
||||
@Override
|
||||
public void logout(String deviceId, boolean clearAllPrefs, MainNavigation mainNavigation) {
|
||||
mNotificationManager.cancelAll();
|
||||
@@ -640,4 +639,30 @@ public class LoginPresenter extends MVPAbstractPresenter<LoginView> implements L
|
||||
getView().showError(R.string.error_username_too_short);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void getAvatar(MainNavigation mainNavigation) {
|
||||
if(mainNavigation == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Subscription subscription = mProfileService.getProfile()
|
||||
.compose(RxUtils.provideDefaultTransformer())
|
||||
.flatMap(new ErrorHandlingResponseConverter<>())
|
||||
.map(profileResponse -> profileResponse.response.user)
|
||||
.subscribe(new Subscriber<User>() {
|
||||
@Override
|
||||
public void onCompleted() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(User user) {
|
||||
mainNavigation.checkAvatarURL(user.avatar);
|
||||
}
|
||||
});
|
||||
addSubscription(subscription);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@ import de.beyondsoft.ownchat.page.main.LogoutNavigation;
|
||||
import de.beyondsoft.ownchat.page.main.MainNavigation;
|
||||
import de.beyondsoft.ownchat.page.mvp.MVPLceView;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/21/17.
|
||||
*/
|
||||
interface LoginView extends MVPLceView {
|
||||
void loginSuccessful();
|
||||
|
||||
|
||||
@@ -14,9 +14,8 @@ import de.beyondsoft.ownchat.page.impressum.ImpressumActivity;
|
||||
import de.beyondsoft.ownchat.page.login.LoginActivity;
|
||||
import de.beyondsoft.ownchat.page.login.LoginPresenter;
|
||||
import de.beyondsoft.ownchat.page.profile.ProfileFragment;
|
||||
import de.beyondsoft.ownchat.utils.BeyondSoftLog;
|
||||
import de.beyondsoft.ownchat.utils.Constants;
|
||||
import de.beyondsoft.ownchat.utils.DialogHandler;/**/
|
||||
import de.beyondsoft.ownchat.utils.DialogHandler;
|
||||
import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.Utils;
|
||||
|
||||
@@ -28,20 +27,24 @@ import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -94,6 +97,7 @@ public class MainActivity extends AppCompatActivity implements MainNavigation, L
|
||||
|
||||
private boolean mLogoutClicked;
|
||||
private Date mBackButtonLastPressed;
|
||||
private MainNavigation mainNavigation;
|
||||
|
||||
public static Intent createIntent(Context context, Bundle bundle, int numberOfUsers, int groupId) {
|
||||
Intent intent = new Intent(context, MainActivity.class);
|
||||
@@ -114,7 +118,9 @@ public class MainActivity extends AppCompatActivity implements MainNavigation, L
|
||||
EventBus.getDefault().register(this);
|
||||
setSupportActionBar(mToolbar);
|
||||
|
||||
// TODO: check avatar
|
||||
mainNavigation = this;
|
||||
|
||||
mLoginPresenter.getAvatar(this);
|
||||
|
||||
View headerLayout = mNavigationView.getHeaderView(0);
|
||||
CircleImageView avatar = headerLayout.findViewById(R.id.menu_profile_imageView);
|
||||
@@ -126,6 +132,9 @@ public class MainActivity extends AppCompatActivity implements MainNavigation, L
|
||||
@Override
|
||||
public void onDrawerOpened(View drawerView) {
|
||||
super.onDrawerOpened(drawerView);
|
||||
|
||||
mLoginPresenter.getAvatar(mainNavigation);
|
||||
|
||||
GlideApp.with(MainActivity.this)
|
||||
.load(mAvatarPreference.get())
|
||||
.into(avatar);
|
||||
@@ -302,4 +311,19 @@ public class MainActivity extends AppCompatActivity implements MainNavigation, L
|
||||
InjectionHelper.destroyMainComponents();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAvatarURL(String avatarURL) {
|
||||
boolean areEqual = mAvatarPreference.get().equals(avatarURL);
|
||||
|
||||
String defaultAvatar = Uri.parse("android.resource://" + R.class.getPackage().getName()+"/"+R.drawable.avatar).toString();
|
||||
|
||||
if(!areEqual) {
|
||||
if(avatarURL == null || TextUtils.isEmpty(avatarURL)) {
|
||||
avatarURL = defaultAvatar;
|
||||
}
|
||||
|
||||
mAvatarPreference.set(avatarURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,10 @@ import de.beyondsoft.ownchat.utils.AppStoppedService;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
/**
|
||||
* Created by laszloffiferenc on 2/22/17.
|
||||
*/
|
||||
@ActivityScope
|
||||
@Component(dependencies = ApplicationComponent.class, modules = {LoginModule.class, ChatModule.class})
|
||||
public interface MainComponent {
|
||||
void inject(MainActivity mainActivity);
|
||||
|
||||
void inject(AppStoppedService appStoppedService);
|
||||
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
package de.beyondsoft.ownchat.page.main;
|
||||
|
||||
/**
|
||||
* Created by imarneanu on 2/10/17.
|
||||
*/
|
||||
public interface MainNavigation {
|
||||
|
||||
void goToContacts();
|
||||
@@ -15,4 +12,5 @@ public interface MainNavigation {
|
||||
|
||||
void goToLoginActivity();
|
||||
|
||||
void checkAvatarURL(String avatarURL);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ProfileFragment extends RuntimePermissionBaseFragment implements Pr
|
||||
private final static int SELECT_FILE = 5055;
|
||||
|
||||
@BindView(R.id.profile_avatar)
|
||||
ImageView mAvatarImageview;
|
||||
ImageView mAvatarImageView;
|
||||
|
||||
@BindView(R.id.profile_name)
|
||||
TextView mNameTextView;
|
||||
@@ -107,7 +107,7 @@ public class ProfileFragment extends RuntimePermissionBaseFragment implements Pr
|
||||
GlideApp.with(getActivity())
|
||||
.load(mAvatarPreference.get())
|
||||
.placeholder(R.drawable.avatar)
|
||||
.into(mAvatarImageview);
|
||||
.into(mAvatarImageView);
|
||||
|
||||
ViewUtils.setProgressBarColor(mProgressBar, R.color.colorDefault);
|
||||
|
||||
@@ -184,7 +184,7 @@ public class ProfileFragment extends RuntimePermissionBaseFragment implements Pr
|
||||
@Override
|
||||
public void setProfile(User user) {
|
||||
if (!TextUtils.isEmpty(user.avatar)) {
|
||||
Glide.with(getActivity()).load(user.avatar).into(mAvatarImageview);
|
||||
Glide.with(getActivity()).load(user.avatar).into(mAvatarImageView);
|
||||
}
|
||||
|
||||
mProfileChangeButton.setEnabled(true);
|
||||
@@ -207,7 +207,7 @@ public class ProfileFragment extends RuntimePermissionBaseFragment implements Pr
|
||||
GlideApp.with(getContext())
|
||||
.load(imageUrl)
|
||||
.error(R.drawable.avatar)
|
||||
.into(mAvatarImageview);
|
||||
.into(mAvatarImageView);
|
||||
|
||||
mAvatarPreference.set(imageUrl);
|
||||
}
|
||||
|
||||
@@ -15,16 +15,10 @@ import de.beyondsoft.ownchat.utils.SystemUtils;
|
||||
import de.beyondsoft.ownchat.utils.rx.RxUtils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
@@ -34,9 +28,6 @@ import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import rx.Subscription;
|
||||
|
||||
/**
|
||||
* Created by imarneanu on 2/22/17.
|
||||
*/
|
||||
@ActivityScope
|
||||
class ProfilePresenter extends MVPAbstractPresenter<ProfileView> implements ProfileView.Callback {
|
||||
|
||||
@@ -74,10 +65,6 @@ class ProfilePresenter extends MVPAbstractPresenter<ProfileView> implements Prof
|
||||
super.beforeDetachView(view);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get logged in user profile.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void getProfile() {
|
||||
Subscription subscription = mProfileService.getProfile()
|
||||
@@ -88,10 +75,6 @@ class ProfilePresenter extends MVPAbstractPresenter<ProfileView> implements Prof
|
||||
addSubscription(subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update phoneNumber for the logged in user.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void updateProfile(String phoneNumber) {
|
||||
Subscription subscription = mProfileService.updateProfile(phoneNumber)
|
||||
@@ -102,10 +85,6 @@ class ProfilePresenter extends MVPAbstractPresenter<ProfileView> implements Prof
|
||||
addSubscription(subscription);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload image for the current user.
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void uploadImage(Uri uri) {
|
||||
if (mSystemUtils.isNetworkUnavailable()) {
|
||||
|
||||
@@ -54,4 +54,6 @@ public interface Constants {
|
||||
String NOTIFICATION_LOG_FILE_NAME = "notification_log";
|
||||
String TEXT_FILE_FORMAT = ".txt";
|
||||
String FIREBASE_LOG = "firebase_log";
|
||||
|
||||
String SAVED_LAYOUT_MANAGER = "saved_recyclerview";
|
||||
}
|
||||
@@ -39,6 +39,8 @@ public abstract class EndlessScrollListener extends RecyclerView.OnScrollListene
|
||||
return;
|
||||
}
|
||||
|
||||
BeyondSoftLog.logScrollingEvent_W("Scrolling...");
|
||||
|
||||
recyclerView.post(() -> {
|
||||
try {
|
||||
if(!mLoading && dy <= 0 && ((totalItemCount - visibleItemCount) <= (mVisibleItem + mVisibleThreshold))) {
|
||||
@@ -53,12 +55,5 @@ public abstract class EndlessScrollListener extends RecyclerView.OnScrollListene
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if loading was started now, false otherwise
|
||||
*/
|
||||
public abstract boolean onLoad();
|
||||
|
||||
public int getVisibleItem() {
|
||||
return mVisibleItem;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".page.chat.BaseChatActivity">
|
||||
|
||||
<include layout="@layout/chat_toolbar" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
@@ -19,8 +18,8 @@
|
||||
android:layout_marginBottom="56dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="?android:attr/actionBarSize"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:layout_marginTop="?android:attr/actionBarSize"
|
||||
tools:listitem="@layout/item_single_chat_left" />
|
||||
|
||||
<de.beyondsoft.ownchat.utils.ui.EmptyLayout
|
||||
|
||||
Reference in New Issue
Block a user