Update libs, remove depricated libs (#566)
proper decleration Merge branch 'update-libs-fix-deps' of codeberg.org:gitnex/GitNex into update-libs-fix-deps import searchview and other improvements Merge branch 'master' into update-libs-fix-deps Update libs, remove depricated libs Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/566 Reviewed-by: opyale <opyale@noreply.codeberg.org>
This commit is contained in:
parent
62aace4b91
commit
3e5e94790e
@ -37,7 +37,7 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
def lifecycle_version = "2.3.0-alpha05"
|
def lifecycle_version = "2.3.0-alpha05"
|
||||||
def markwon_version = '4.3.1'
|
def markwon_version = '4.4.0'
|
||||||
def acra = "5.5.0"
|
def acra = "5.5.0"
|
||||||
|
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
@ -45,18 +45,19 @@ dependencies {
|
|||||||
implementation "com.google.android.material:material:1.3.0-alpha01"
|
implementation "com.google.android.material:material:1.3.0-alpha01"
|
||||||
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
||||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||||
|
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
|
||||||
testImplementation "junit:junit:4.13"
|
testImplementation "junit:junit:4.13"
|
||||||
androidTestImplementation "androidx.test:runner:1.2.0"
|
androidTestImplementation "androidx.test:runner:1.2.0"
|
||||||
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
|
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
|
||||||
implementation "com.github.vihtarb:tooltip:0.2.0"
|
implementation "com.github.vihtarb:tooltip:0.2.0"
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.7.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
|
||||||
implementation "com.google.code.gson:gson:2.8.6"
|
implementation "com.google.code.gson:gson:2.8.6"
|
||||||
implementation "com.squareup.picasso:picasso:2.71828"
|
implementation "com.squareup.picasso:picasso:2.71828"
|
||||||
implementation "com.amulyakhare:com.amulyakhare.textdrawable:1.0.1"
|
implementation "com.amulyakhare:com.amulyakhare.textdrawable:1.0.1"
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-scalars:2.8.1'
|
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.0'
|
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
|
||||||
implementation 'org.ocpsoft.prettytime:prettytime:4.0.5.Final'
|
implementation 'org.ocpsoft.prettytime:prettytime:4.0.5.Final'
|
||||||
implementation "com.vdurmont:emoji-java:5.1.1"
|
implementation "com.vdurmont:emoji-java:5.1.1"
|
||||||
implementation "com.pes.materialcolorpicker:library:1.2.5"
|
implementation "com.pes.materialcolorpicker:library:1.2.5"
|
||||||
@ -77,8 +78,6 @@ dependencies {
|
|||||||
implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.19"
|
implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.19"
|
||||||
implementation "com.hendraanggrian.appcompat:socialview:0.2"
|
implementation "com.hendraanggrian.appcompat:socialview:0.2"
|
||||||
implementation "com.hendraanggrian.appcompat:socialview-commons:0.2"
|
implementation "com.hendraanggrian.appcompat:socialview-commons:0.2"
|
||||||
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" // Deprecated (https://developer.android.com/jetpack/androidx/releases/lifecycle)
|
|
||||||
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
|
|
||||||
implementation "com.github.HamidrezaAmz:BreadcrumbsView:0.2.9"
|
implementation "com.github.HamidrezaAmz:BreadcrumbsView:0.2.9"
|
||||||
implementation "commons-io:commons-io:20030203.000550"
|
implementation "commons-io:commons-io:20030203.000550"
|
||||||
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
package org.mian.gitnex.activities;
|
package org.mian.gitnex.activities;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
|
||||||
import androidx.lifecycle.Observer;
|
|
||||||
import androidx.lifecycle.ViewModelProviders;
|
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -19,15 +11,20 @@ import android.view.View;
|
|||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import androidx.appcompat.widget.SearchView;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.adapters.AdminGetUsersAdapter;
|
import org.mian.gitnex.adapters.AdminGetUsersAdapter;
|
||||||
import org.mian.gitnex.fragments.BottomSheetAdminUsersFragment;
|
import org.mian.gitnex.fragments.BottomSheetAdminUsersFragment;
|
||||||
import org.mian.gitnex.helpers.Authorization;
|
import org.mian.gitnex.helpers.Authorization;
|
||||||
import org.mian.gitnex.models.UserInfo;
|
|
||||||
import org.mian.gitnex.util.AppUtil;
|
import org.mian.gitnex.util.AppUtil;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
import org.mian.gitnex.viewmodels.AdminGetUsersViewModel;
|
import org.mian.gitnex.viewmodels.AdminGetUsersViewModel;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author M M Arif
|
* Author M M Arif
|
||||||
@ -78,18 +75,12 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
DividerItemDecoration.VERTICAL);
|
DividerItemDecoration.VERTICAL);
|
||||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||||
|
|
||||||
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
swipeRefresh.setOnRefreshListener(() -> new Handler().postDelayed(() -> {
|
||||||
@Override
|
|
||||||
public void onRefresh() {
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
swipeRefresh.setRefreshing(false);
|
swipeRefresh.setRefreshing(false);
|
||||||
AdminGetUsersViewModel.loadUsersList(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
|
AdminGetUsersViewModel.loadUsersList(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
|
||||||
}
|
|
||||||
}, 500);
|
}, 500));
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
fetchDataAsync(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
|
fetchDataAsync(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
|
||||||
|
|
||||||
@ -97,11 +88,10 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
|
|
||||||
private void fetchDataAsync(Context ctx, String instanceUrl, String instanceToken) {
|
private void fetchDataAsync(Context ctx, String instanceUrl, String instanceToken) {
|
||||||
|
|
||||||
AdminGetUsersViewModel usersModel = ViewModelProviders.of(this).get(AdminGetUsersViewModel.class);
|
AdminGetUsersViewModel usersModel = new ViewModelProvider(this).get(AdminGetUsersViewModel.class);
|
||||||
|
|
||||||
|
usersModel.getUsersList(ctx, instanceUrl, instanceToken).observe(this, usersListMain -> {
|
||||||
|
|
||||||
usersModel.getUsersList(ctx, instanceUrl, instanceToken).observe(this, new Observer<List<UserInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onChanged(@Nullable List<UserInfo> usersListMain) {
|
|
||||||
adapter = new AdminGetUsersAdapter(ctx, usersListMain);
|
adapter = new AdminGetUsersAdapter(ctx, usersListMain);
|
||||||
if(adapter.getItemCount() > 0) {
|
if(adapter.getItemCount() > 0) {
|
||||||
mRecyclerView.setVisibility(View.VISIBLE);
|
mRecyclerView.setVisibility(View.VISIBLE);
|
||||||
@ -115,7 +105,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
mRecyclerView.setVisibility(View.GONE);
|
mRecyclerView.setVisibility(View.GONE);
|
||||||
noDataUsers.setVisibility(View.VISIBLE);
|
noDataUsers.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -126,9 +116,8 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
final MenuInflater inflater = getMenuInflater();
|
final MenuInflater inflater = getMenuInflater();
|
||||||
inflater.inflate(R.menu.generic_nav_dotted_menu, menu);
|
inflater.inflate(R.menu.generic_nav_dotted_menu, menu);
|
||||||
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if(searchFilter) {
|
if(searchFilter) {
|
||||||
|
|
||||||
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
|
||||||
@ -136,7 +125,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
inflater.inflate(R.menu.search_menu, menu);
|
inflater.inflate(R.menu.search_menu, menu);
|
||||||
|
|
||||||
MenuItem searchItem = menu.findItem(R.id.action_search);
|
MenuItem searchItem = menu.findItem(R.id.action_search);
|
||||||
androidx.appcompat.widget.SearchView searchView = (androidx.appcompat.widget.SearchView) searchItem.getActionView();
|
SearchView searchView = (SearchView) searchItem.getActionView();
|
||||||
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||||
|
|
||||||
if(!connToInternet) {
|
if(!connToInternet) {
|
||||||
@ -144,19 +133,19 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) { return true; }
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
adapter.getFilter().filter(newText);
|
adapter.getFilter().filter(newText);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -193,12 +182,7 @@ public class AdminGetUsersActivity extends BaseActivity implements BottomSheetAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initCloseListener() {
|
private void initCloseListener() {
|
||||||
onClickListener = new View.OnClickListener() {
|
onClickListener = view -> finish();
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user