Compare commits

..

19 Commits

Author SHA1 Message Date
f135508745 Release 3.0.0 rc3 (#570)
Release 3.0.0 rc3

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/570
2020-06-30 21:08:10 +02:00
3e5e94790e 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>
2020-06-30 20:59:11 +02:00
62aace4b91 Fix old URLs which do not have a slash at the end. (#568)
Merge branch 'master' into fix-older-urls

Fix old URLs which do not have a slash at the end.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/568
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-30 20:36:24 +02:00
2412245a9f Fixing path issues. (#567)
Fixing path issues.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/567
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-30 20:19:55 +02:00
e872069093 Proper URL parsing, label redesign and other improvements. (#564)
Final improvements.

Fixing reply mention.

Do NOT use "instanceUrlRaw" as of now.

Minor fixes

Merge remote-tracking branch 'remotes/main/master' into login-fix

URL parsing, label and other improvements.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/564
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-30 16:43:27 +02:00
5672208fd0 Adding ability to quote and to copy issue comments. (#562)
Minor fix.

Merge branch 'master' into reply-tools

Merge remote-tracking branch 'opyale/reply-tools' into reply-tools

Changing names.

Merge branch 'master' into reply-tools

Adding ability to cite and to copy issue comments.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Co-authored-by: 6543 <6543@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/562
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-28 19:26:59 +02:00
7379e9945d Fixing bugs of previous pull (#563)
Fixing bugs of previous pull.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/563
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-06-28 18:48:33 +02:00
815417bf11 Refactoring LoginActivity and other improvements. (#561)
Adding error message for login().

Final touch.

Refactoring LoginActivity and other improvements.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/561
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-06-28 17:11:59 +02:00
95fc5e1e9a Fix bug #549, add more file ext to file viewer (#560)
Fix empty release notes bug

Add new sponsor

Fix bug #549, add more file ext to file viewer

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/560
Reviewed-by: opyale <opyale@noreply.codeberg.org>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-06-28 16:45:39 +02:00
f285d47a0b Fix Crash on closed PRs with deleted Fork (#559)
Fix edge-case DeletedFork of a Pull-Branch

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-26 17:09:18 +02:00
2483968f11 Inverting color of divider too (#553)
Inverting color of divider too

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-06-25 01:27:13 +02:00
d0fde4e791 Adjusting icon color to fit background. (#551)
Adjusting icon color to fit background.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-24 23:02:22 +02:00
c7c2ac2a11 Enhance bottomsheets ui (#550)
Fix name collision in themes

Add space between org and repo name

standard use of dimens

more ui improvements

wip to enhance all bottom sheets

Fix radius and improve the ui

enhance bottom sheet

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-by: opyale <opyale@noreply.codeberg.org>
2020-06-24 22:29:58 +02:00
4f79ea0156 Fix Crash when searching issues/pr (#547)
fix in pr and ms fragments

Fix Crash when searching issues/pr

Co-authored-by: M M Arif <mmarif@swatian.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-24 17:05:02 +02:00
22943ca9cd Fix user team search crash (#545)
Fix team user search crash

Refactor userName

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-06-23 20:59:23 +02:00
5a10127c1c Calculate ImageContrastColor more precise & some doc nits (#544)
Fixing color bug, updating license headers and CONTRIBUTORS

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-23 16:54:27 +02:00
7de29687eb Fixing collaborators bug and some improvements in RepoDetailActivity (#543)
* Minor improvements.

* Fixing collaborators bug and many (performance) improvements in RepoDetailActivity.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-06-22 18:28:08 +02:00
1a95475140 Gitea >= v1.12.0 only need read rights for Colaborators Tab (#542)
show "Add Collaborator" option only if you have the right to do so

gitea >= v1.12.0 only need read rights for Colaborators Tab

Signed-off-by: 6543 <6543@obermui.de>

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
2020-06-22 17:59:36 +02:00
d2265aecae Fix profile title (#541)
Fix profile
2020-06-22 09:57:21 +02:00
88 changed files with 1240 additions and 1218 deletions

View File

@ -20,3 +20,7 @@ indent_size = 2
[{*.yml,*.yaml}] [{*.yml,*.yaml}]
indent_size = 2 indent_size = 2
[*.md]
trim_trailing_whitespace = false
insert_final_newline = false

View File

@ -36,6 +36,7 @@
<option name="SPACE_BEFORE_CATCH_PARENTHESES" value="false" /> <option name="SPACE_BEFORE_CATCH_PARENTHESES" value="false" />
<option name="SPACE_BEFORE_SWITCH_PARENTHESES" value="false" /> <option name="SPACE_BEFORE_SWITCH_PARENTHESES" value="false" />
<option name="SPACE_BEFORE_SYNCHRONIZED_PARENTHESES" value="false" /> <option name="SPACE_BEFORE_SYNCHRONIZED_PARENTHESES" value="false" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" /> <option name="IF_BRACE_FORCE" value="3" />
<option name="WRAP_ON_TYPING" value="1" /> <option name="WRAP_ON_TYPING" value="1" />
<indentOptions> <indentOptions>
@ -156,4 +157,4 @@
</arrangement> </arrangement>
</codeStyleSettings> </codeStyleSettings>
</code_scheme> </code_scheme>
</component> </component>

View File

@ -3,6 +3,7 @@ This part lists all PUBLIC individuals having contributed content to the code.
* M M Arif (mmarif) * M M Arif (mmarif)
* 6543 * 6543
* opyale
* Unpublished * Unpublished
# Translators # Translators

View File

@ -66,7 +66,7 @@ We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your la
## Thanks ## Thanks
Thanks to all the open source libraries, contributors and donators. Thanks to all the open source libraries, contributors and donators.
Open source libraries #### Open source libraries
- Retrofit - Retrofit
- Gson - Gson
- Okhttp - Okhttp
@ -88,5 +88,6 @@ Open source libraries
- Barteksc/AndroidPdfViewer - Barteksc/AndroidPdfViewer
- Ge0rg/MemorizingTrustManager - Ge0rg/MemorizingTrustManager
- Dimezis/BlurView - Dimezis/BlurView
- mikaelhg/urlbuilder
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif) [Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)

View File

@ -6,8 +6,8 @@ android {
applicationId "org.mian.gitnex" applicationId "org.mian.gitnex"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 296 versionCode 297
versionName "3.0.0-rc2" versionName "3.0.0-rc3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
viewBinding { viewBinding {
@ -36,8 +36,8 @@ configurations {
} }
dependencies { dependencies {
def lifecycle_version = "2.2.0" 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:$lifecycle_version"
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"
@ -86,6 +85,7 @@ dependencies {
implementation "ch.acra:acra-mail:$acra" implementation "ch.acra:acra-mail:$acra"
implementation "ch.acra:acra-limiter:$acra" implementation "ch.acra:acra-limiter:$acra"
implementation "ch.acra:acra-notification:$acra" implementation "ch.acra:acra-notification:$acra"
implementation 'com.eightbitlab:blurview:1.6.3' implementation "com.eightbitlab:blurview:1.6.3"
implementation "io.mikael:urlbuilder:2.0.9"
} }

View File

@ -96,7 +96,7 @@ public class AddNewTeamMemberActivity extends BaseActivity {
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) { public void onTextChanged(CharSequence s, int start, int before, int count) {
if(!addNewTeamMember.getText().toString().equals("")) { if(!addNewTeamMember.getText().toString().equals("") && addNewTeamMember.getText().toString().length() > 1) {
adapter = new UserSearchForTeamMemberAdapter(dataList, ctx, Integer.parseInt(teamId)); adapter = new UserSearchForTeamMemberAdapter(dataList, ctx, Integer.parseInt(teamId));
loadUserSearchList(instanceUrl, instanceToken, addNewTeamMember.getText().toString(), loginUid, teamId); loadUserSearchList(instanceUrl, instanceToken, addNewTeamMember.getText().toString(), loginUid, teamId);

View File

@ -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,16 +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;
import java.util.Objects;
/** /**
* Author M M Arif * Author M M Arif
@ -79,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() { swipeRefresh.setRefreshing(false);
new Handler().postDelayed(new Runnable() { AdminGetUsersViewModel.loadUsersList(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
@Override
public void run() { }, 500));
swipeRefresh.setRefreshing(false);
AdminGetUsersViewModel.loadUsersList(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
}
}, 500);
}
});
fetchDataAsync(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken)); fetchDataAsync(ctx, instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken));
@ -98,25 +88,24 @@ 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, new Observer<List<UserInfo>>() { usersModel.getUsersList(ctx, instanceUrl, instanceToken).observe(this, usersListMain -> {
@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); mRecyclerView.setAdapter(adapter);
mRecyclerView.setAdapter(adapter); noDataUsers.setVisibility(View.GONE);
noDataUsers.setVisibility(View.GONE); searchFilter = true;
searchFilter = true;
}
else {
//adapter.notifyDataSetChanged();
//mRecyclerView.setAdapter(adapter);
mRecyclerView.setVisibility(View.GONE);
noDataUsers.setVisibility(View.VISIBLE);
}
} }
else {
//adapter.notifyDataSetChanged();
//mRecyclerView.setAdapter(adapter);
mRecyclerView.setVisibility(View.GONE);
noDataUsers.setVisibility(View.VISIBLE);
}
}); });
} }
@ -127,37 +116,36 @@ 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) {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); if(searchFilter) {
inflater.inflate(R.menu.search_menu, menu); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
MenuItem searchItem = menu.findItem(R.id.action_search); inflater.inflate(R.menu.search_menu, menu);
androidx.appcompat.widget.SearchView searchView = (androidx.appcompat.widget.SearchView) searchItem.getActionView();
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
if(!connToInternet) { MenuItem searchItem = menu.findItem(R.id.action_search);
return; SearchView searchView = (SearchView) searchItem.getActionView();
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
if(!connToInternet) {
return;
}
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) { return true; }
@Override
public boolean onQueryTextChange(String newText) {
adapter.getFilter().filter(newText);
return false;
} }
searchView.setOnQueryTextListener(new androidx.appcompat.widget.SearchView.OnQueryTextListener() { });
@Override
public boolean onQueryTextSubmit(String query) {
return true;
}
@Override
public boolean onQueryTextChange(String newText) {
adapter.getFilter().filter(newText);
return false;
}
});
}
} }
}, 500); }, 500);
return true; return true;
@ -194,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();
}
};
} }
} }

View File

@ -103,6 +103,11 @@ public abstract class BaseActivity extends AppCompatActivity {
tinyDb.putString("cacheSizeImagesStr", getResources().getString(R.string.cacheSizeImagesSelectionSelectedText)); tinyDb.putString("cacheSizeImagesStr", getResources().getString(R.string.cacheSizeImagesSelectionSelectedText));
} }
if(!tinyDb.getString("instanceUrlWithProtocol").endsWith("/")) {
tinyDb.putString("instanceUrlWithProtocol", tinyDb.getString("instanceUrlWithProtocol") + "/");
}
if (tinyDb.getBoolean("crashReportingEnabled")) { if (tinyDb.getBoolean("crashReportingEnabled")) {
CoreConfigurationBuilder ACRABuilder = new CoreConfigurationBuilder(this); CoreConfigurationBuilder ACRABuilder = new CoreConfigurationBuilder(this);

View File

@ -61,7 +61,7 @@ public class CreateFileActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -146,7 +146,7 @@ public class CreateFileActivity extends BaseActivity {
private void processNewFile() { private void processNewFile() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");

View File

@ -82,7 +82,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -153,7 +153,7 @@ public class CreateIssueActivity extends BaseActivity implements View.OnClickLis
private void processNewIssue() { private void processNewIssue() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid"); final String loginUid = tinyDb.getString("loginUid");

View File

@ -73,7 +73,7 @@ public class CreateLabelActivity extends BaseActivity {
} }
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
ImageView closeActivity = findViewById(R.id.close); ImageView closeActivity = findViewById(R.id.close);
colorPicker = findViewById(R.id.colorPicker); colorPicker = findViewById(R.id.colorPicker);
@ -154,7 +154,7 @@ public class CreateLabelActivity extends BaseActivity {
private void processUpdateLabel() { private void processUpdateLabel() {
final TinyDB tinyDb = new TinyDB(appCtx); final TinyDB tinyDb = new TinyDB(appCtx);
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
String repoFullName = tinyDb.getString("repoFullName"); String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/"); String[] parts = repoFullName.split("/");
@ -202,7 +202,7 @@ public class CreateLabelActivity extends BaseActivity {
private void processCreateLabel() { private void processCreateLabel() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
String repoFullName = tinyDb.getString("repoFullName"); String repoFullName = tinyDb.getString("repoFullName");
@ -446,4 +446,4 @@ public class CreateLabelActivity extends BaseActivity {
} }
} }

View File

@ -50,7 +50,7 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -92,7 +92,7 @@ public class CreateMilestoneActivity extends BaseActivity implements View.OnClic
private void processNewMilestone() { private void processNewMilestone() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
String repoFullName = tinyDb.getString("repoFullName"); String repoFullName = tinyDb.getString("repoFullName");

View File

@ -48,7 +48,7 @@ public class CreateNewUserActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -80,7 +80,7 @@ public class CreateNewUserActivity extends BaseActivity {
private void processCreateNewUser() { private void processCreateNewUser() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");

View File

@ -47,7 +47,7 @@ public class CreateOrganizationActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -97,7 +97,7 @@ public class CreateOrganizationActivity extends BaseActivity {
private void processNewOrganization() { private void processNewOrganization() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");

View File

@ -60,7 +60,7 @@ public class CreateReleaseActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -125,7 +125,7 @@ public class CreateReleaseActivity extends BaseActivity {
private void processNewRelease() { private void processNewRelease() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");

View File

@ -64,7 +64,7 @@ public class CreateRepoActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(ctx); boolean connToInternet = AppUtil.hasNetworkConnection(ctx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");
@ -124,7 +124,7 @@ public class CreateRepoActivity extends BaseActivity {
private void processNewRepo() { private void processNewRepo() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
AppUtil appUtil = new AppUtil(); AppUtil appUtil = new AppUtil();
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");

View File

@ -78,7 +78,7 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -256,7 +256,7 @@ public class CreateTeamByOrgActivity extends BaseActivity implements View.OnClic
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token"); final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
final String orgName = tinyDb.getString("orgName");; final String orgName = tinyDb.getString("orgName");;
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
String newTeamName = teamName.getText().toString(); String newTeamName = teamName.getText().toString();
String newTeamDesc = teamDesc.getText().toString(); String newTeamDesc = teamDesc.getText().toString();
String newTeamPermission = teamPermission.getText().toString().toLowerCase(); String newTeamPermission = teamPermission.getText().toString().toLowerCase();

View File

@ -196,7 +196,7 @@ public class EditIssueActivity extends BaseActivity implements View.OnClickListe
private void processEditIssue() { private void processEditIssue() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid"); final String loginUid = tinyDb.getString("loginUid");

View File

@ -106,7 +106,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
tinyDb.putInt("homeScreenId", 0); tinyDb.putInt("homeScreenId", 0);
} }
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
if(!tinyDb.getBoolean("loggedInMode")) { if(!tinyDb.getBoolean("loggedInMode")) {
logout(this, ctx); logout(this, ctx);
@ -243,6 +243,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
userAvatar.setOnClickListener(v -> { userAvatar.setOnClickListener(v -> {
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit(); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
drawer.closeDrawers(); drawer.closeDrawers();
}); });
@ -514,7 +515,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
tinyDb.putString("userLang", userDetails.getLang()); tinyDb.putString("userLang", userDetails.getLang());
} }
else { else {
tinyDb.putString("userLang", "..."); tinyDb.putString("userLang", "");
} }
} }
} }
@ -525,7 +526,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
} }
else { else {
String toastError = getResources().getString(R.string.genericApiStatusError) + String.valueOf(response.code()); String toastError = getResources().getString(R.string.genericApiStatusError) + response.code();
Toasty.info(ctx, toastError); Toasty.info(ctx, toastError);
} }

View File

@ -62,7 +62,7 @@ public class MergePullRequestActivity extends BaseActivity {
View view = viewBinding.getRoot(); View view = viewBinding.getRoot();
setContentView(view); setContentView(view);
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -217,7 +217,7 @@ public class MergePullRequestActivity extends BaseActivity {
String mergePRTitle = viewBinding.mergeTitle.getText().toString(); String mergePRTitle = viewBinding.mergeTitle.getText().toString();
boolean deleteBranch = viewBinding.deleteBranch.isChecked(); boolean deleteBranch = viewBinding.deleteBranch.isChecked();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
if(!connToInternet) { if(!connToInternet) {

View File

@ -5,7 +5,13 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import org.mian.gitnex.R;
import org.mian.gitnex.helpers.PathsHelper;
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.util.TinyDB; import org.mian.gitnex.util.TinyDB;
import java.net.URI;
import java.net.URISyntaxException;
import io.mikael.urlbuilder.UrlBuilder;
/** /**
* Author M M Arif * Author M M Arif
@ -18,20 +24,28 @@ public class OpenRepoInBrowserActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
TinyDB tinyDb = new TinyDB(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); try {
String instanceUrlWithProtocol = "https://" + tinyDb.getString("instanceUrlRaw");
if (!tinyDb.getString("instanceUrlWithProtocol").isEmpty()) {
instanceUrlWithProtocol = tinyDb.getString("instanceUrlWithProtocol");
}
String repoFullNameBrowser = getIntent().getStringExtra("repoFullNameBrowser"); URI instanceUrl = new URI(tinyDb.getString("instanceUrlWithProtocol"));
Uri url = Uri.parse(instanceUrlWithProtocol + "/" + repoFullNameBrowser);
Intent i = new Intent(Intent.ACTION_VIEW, url); String browserPath = PathsHelper.join(instanceUrl.getPath(), getIntent().getStringExtra("repoFullNameBrowser"));
startActivity(i);
finish(); String browserUrl = UrlBuilder.fromUri(instanceUrl)
.withPath(browserPath)
.toString();
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(browserUrl));
startActivity(i);
finish();
}
catch(URISyntaxException e) {
Toasty.error(appCtx, getString(R.string.genericError));
}
} }

View File

@ -49,7 +49,7 @@ public class ProfileEmailActivity extends BaseActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
@ -84,7 +84,7 @@ public class ProfileEmailActivity extends BaseActivity {
private void processAddNewEmail() { private void processAddNewEmail() {
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid"); final String loginUid = tinyDb.getString("loginUid");

View File

@ -58,13 +58,13 @@ public class ReplyToIssueActivity extends BaseActivity {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
TinyDB tinyDb = new TinyDB(appCtx); TinyDB tinyDb = new TinyDB(appCtx);
addComment = findViewById(R.id.addComment); addComment = findViewById(R.id.addComment);
addComment.setShowSoftInputOnFocus(true); addComment.setShowSoftInputOnFocus(true);
defaultMentionAdapter = new MentionArrayAdapter<>(this); defaultMentionAdapter = new MentionArrayAdapter<>(ctx);
loadCollaboratorsList(); loadCollaboratorsList();
addComment.setMentionAdapter(defaultMentionAdapter); addComment.setMentionAdapter(defaultMentionAdapter);
@ -191,7 +191,7 @@ public class ReplyToIssueActivity extends BaseActivity {
private void processNewCommentReply() { private void processNewCommentReply() {
String newReplyDT = addComment.getText().toString(); String newReplyDT = addComment.getText().toString();
boolean connToInternet = AppUtil.haveNetworkConnection(appCtx); boolean connToInternet = AppUtil.hasNetworkConnection(appCtx);
if(!connToInternet) { if(!connToInternet) {

View File

@ -42,7 +42,6 @@ import org.mian.gitnex.helpers.Authorization;
import org.mian.gitnex.helpers.Version; import org.mian.gitnex.helpers.Version;
import org.mian.gitnex.models.UserRepositories; import org.mian.gitnex.models.UserRepositories;
import org.mian.gitnex.models.WatchInfo; import org.mian.gitnex.models.WatchInfo;
import org.mian.gitnex.util.AppUtil;
import org.mian.gitnex.util.TinyDB; import org.mian.gitnex.util.TinyDB;
import java.util.Objects; import java.util.Objects;
import retrofit2.Call; import retrofit2.Call;
@ -63,59 +62,19 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
private FragmentRefreshListenerPr fragmentRefreshListenerPr; private FragmentRefreshListenerPr fragmentRefreshListenerPr;
private FragmentRefreshListenerMilestone fragmentRefreshListenerMilestone; private FragmentRefreshListenerMilestone fragmentRefreshListenerMilestone;
final Context ctx = this; private final Context ctx = this;
private Context appCtx; private Context appCtx;
// issues interface private TinyDB tinyDB;
public FragmentRefreshListener getFragmentRefreshListener() {
return fragmentRefreshListener; private String instanceUrl;
} private String loginUid;
private String instanceToken;
public void setFragmentRefreshListener(FragmentRefreshListener fragmentRefreshListener) { private String repositoryOwner;
private String repositoryName;
this.fragmentRefreshListener = fragmentRefreshListener; private int tabsCount;
}
public interface FragmentRefreshListener {
void onRefresh(String text);
}
// pr interface
public FragmentRefreshListenerPr getFragmentRefreshListenerPr() {
return fragmentRefreshListenerPr;
}
public void setFragmentRefreshListenerPr(FragmentRefreshListenerPr fragmentRefreshListenerPr) {
this.fragmentRefreshListenerPr = fragmentRefreshListenerPr;
}
public interface FragmentRefreshListenerPr {
void onRefresh(String text);
}
// milestones interface
public FragmentRefreshListenerMilestone getFragmentRefreshListenerMilestone() {
return fragmentRefreshListenerMilestone;
}
public void setFragmentRefreshListenerMilestone(FragmentRefreshListenerMilestone fragmentRefreshListenerMilestone) {
this.fragmentRefreshListenerMilestone = fragmentRefreshListenerMilestone;
}
public interface FragmentRefreshListenerMilestone {
void onRefresh(String text);
}
@Override @Override
protected int getLayoutResourceId() { protected int getLayoutResourceId() {
@ -129,40 +88,32 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
appCtx = getApplicationContext(); appCtx = getApplicationContext();
TinyDB tinyDb = new TinyDB(appCtx); tinyDB = new TinyDB(appCtx);
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
String repoName1 = parts[1];
final String instanceUrl = tinyDb.getString("instanceUrl"); String[] repoNameParts = tinyDB.getString("repoFullName").split("/");
final String repoOwner = parts[0]; repositoryOwner = repoNameParts[0];
final String loginUid = tinyDb.getString("loginUid"); repositoryName = repoNameParts[1];
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
tinyDb.putString("repoIssuesState", "open");
tinyDb.putString("repoPrState", "open");
tinyDb.putString("milestoneState", "open");
String appLocale = tinyDb.getString("locale");
AppUtil.setAppLocale(getResources(), appLocale);
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title); TextView toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
toolbarTitle.setText(repositoryName);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
Objects.requireNonNull(getSupportActionBar()).setTitle(repoName1); Objects.requireNonNull(getSupportActionBar()).setTitle(repositoryName);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); instanceUrl = tinyDB.getString("instanceUrl");
loginUid = tinyDB.getString("loginUid");
instanceToken = "token " + tinyDB.getString(loginUid + "-token");
ViewPager mViewPager = findViewById(R.id.container); tinyDB.putString("repoIssuesState", "open");
mViewPager.setAdapter(mSectionsPagerAdapter); tinyDB.putString("repoPrState", "open");
tinyDB.putString("milestoneState", "open");
TabLayout tabLayout = findViewById(R.id.tabs);
Typeface myTypeface; Typeface myTypeface;
switch(tinyDb.getInt("customFontId", -1)) { switch(tinyDB.getInt("customFontId", -1)) {
case 0: case 0:
myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/roboto.ttf"); myTypeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/roboto.ttf");
@ -179,34 +130,50 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
} }
toolbarTitle.setTypeface(myTypeface); toolbarTitle.setTypeface(myTypeface);
toolbarTitle.setText(repoName1);
ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0); TabLayout tabLayout = findViewById(R.id.tabs);
int tabsCount = vg.getChildCount();
ViewGroup viewGroup = (ViewGroup) tabLayout.getChildAt(0);
tabsCount = viewGroup.getChildCount();
for(int j = 0; j < tabsCount; j++) { for(int j = 0; j < tabsCount; j++) {
ViewGroup vgTab = (ViewGroup) vg.getChildAt(j);
ViewGroup vgTab = (ViewGroup) viewGroup.getChildAt(j);
int tabChildCount = vgTab.getChildCount(); int tabChildCount = vgTab.getChildCount();
for(int i = 0; i < tabChildCount; i++) { for(int i = 0; i < tabChildCount; i++) {
View tabViewChild = vgTab.getChildAt(i); View tabViewChild = vgTab.getChildAt(i);
if(tabViewChild instanceof TextView) { if(tabViewChild instanceof TextView) {
((TextView) tabViewChild).setTypeface(myTypeface); ((TextView) tabViewChild).setTypeface(myTypeface);
} }
} }
} }
// only show Collaborators if you have permission to // Only show collaborators tab, if you have permission to
final View collaboratorTab = vg.getChildAt(8); View collaboratorTab = viewGroup.getChildAt(8);
if(tinyDb.getBoolean("isRepoAdmin")) {
if(tinyDB.getBoolean("isRepoAdmin") || new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.12.0")) {
collaboratorTab.setVisibility(View.VISIBLE); collaboratorTab.setVisibility(View.VISIBLE);
} }
else { else {
tabsCount--;
collaboratorTab.setVisibility(View.GONE); collaboratorTab.setVisibility(View.GONE);
} }
ViewPager mViewPager = findViewById(R.id.container);
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager)); tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
if(tinyDb.getBoolean("enableCounterBadges")) { SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
mViewPager.setAdapter(mSectionsPagerAdapter);
if(tinyDB.getBoolean("enableCounterBadges")) {
@SuppressLint("InflateParams") View tabHeader2 = LayoutInflater.from(this).inflate(R.layout.badge_issue, null); @SuppressLint("InflateParams") View tabHeader2 = LayoutInflater.from(this).inflate(R.layout.badge_issue, null);
textViewBadgeIssue = tabHeader2.findViewById(R.id.counterBadgeIssue); textViewBadgeIssue = tabHeader2.findViewById(R.id.counterBadgeIssue);
@ -221,41 +188,48 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
textViewBadgePull.setVisibility(View.GONE); textViewBadgePull.setVisibility(View.GONE);
textViewBadgeRelease.setVisibility(View.GONE); textViewBadgeRelease.setVisibility(View.GONE);
getRepoInfo(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName1); getRepoInfo(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repositoryOwner, repositoryName);
ColorStateList textColor = tabLayout.getTabTextColors(); ColorStateList textColor = tabLayout.getTabTextColors();
// issue count // Issue count
if(textViewBadgeIssue.getText() != "") { if(textViewBadgeIssue.getText() != "") {
TabLayout.Tab tabOpenIssues = tabLayout.getTabAt(2); TabLayout.Tab tabOpenIssues = tabLayout.getTabAt(2);
Objects.requireNonNull(tabLayout.getTabAt(2)).setCustomView(tabHeader2); Objects.requireNonNull(tabLayout.getTabAt(2)).setCustomView(tabHeader2);
assert tabOpenIssues != null; assert tabOpenIssues != null; // FIXME This should be cleaned up
TextView openIssueTabView = Objects.requireNonNull(tabOpenIssues.getCustomView()).findViewById(R.id.counterBadgeIssueText); TextView openIssueTabView = Objects.requireNonNull(tabOpenIssues.getCustomView()).findViewById(R.id.counterBadgeIssueText);
openIssueTabView.setTextColor(textColor); openIssueTabView.setTextColor(textColor);
} }
// pull count // Pull request count
if(textViewBadgePull.getText() != "") { // only show if API returned a number if(textViewBadgePull.getText() != "") { // only show if API returned a number
Objects.requireNonNull(tabLayout.getTabAt(3)).setCustomView(tabHeader4); Objects.requireNonNull(tabLayout.getTabAt(3)).setCustomView(tabHeader4);
TabLayout.Tab tabOpenPulls = tabLayout.getTabAt(3); TabLayout.Tab tabOpenPulls = tabLayout.getTabAt(3);
assert tabOpenPulls != null; assert tabOpenPulls != null; // FIXME This should be cleaned up
TextView openPullTabView = Objects.requireNonNull(tabOpenPulls.getCustomView()).findViewById(R.id.counterBadgePullText); TextView openPullTabView = Objects.requireNonNull(tabOpenPulls.getCustomView()).findViewById(R.id.counterBadgePullText);
openPullTabView.setTextColor(textColor); openPullTabView.setTextColor(textColor);
} }
// release count // Release count
if(new Version("1.11.4").less(tinyDb.getString("giteaVersion"))) { if(new Version("1.11.4").less(tinyDB.getString("giteaVersion"))) {
if(textViewBadgeRelease.getText() != "") { // only show if API returned a number if(textViewBadgeRelease.getText() != "") { // only show if API returned a number
Objects.requireNonNull(tabLayout.getTabAt(5)).setCustomView(tabHeader6); Objects.requireNonNull(tabLayout.getTabAt(5)).setCustomView(tabHeader6);
TabLayout.Tab tabOpenRelease = tabLayout.getTabAt(5); TabLayout.Tab tabOpenRelease = tabLayout.getTabAt(5);
assert tabOpenRelease != null; assert tabOpenRelease != null; // FIXME This should be cleaned up
TextView openReleaseTabView = Objects.requireNonNull(tabOpenRelease.getCustomView()).findViewById(R.id.counterBadgeReleaseText); TextView openReleaseTabView = Objects.requireNonNull(tabOpenRelease.getCustomView()).findViewById(R.id.counterBadgeReleaseText);
openReleaseTabView.setTextColor(textColor); openReleaseTabView.setTextColor(textColor);
} }
} }
} }
checkRepositoryStarStatus(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName1); checkRepositoryStarStatus(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repositoryOwner, repositoryName);
checkRepositoryWatchStatus(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName1); checkRepositoryWatchStatus(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repositoryOwner, repositoryName);
} }
@ -263,17 +237,10 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
TinyDB tinyDb = new TinyDB(appCtx);
final String instanceUrl = tinyDb.getString("instanceUrl");
final String loginUid = tinyDb.getString("loginUid");
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
final String repoOwner = parts[0];
final String repoName = parts[1];
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
if(tinyDb.getBoolean("enableCounterIssueBadge")) { if(tinyDB.getBoolean("enableCounterIssueBadge")) {
getRepoInfo(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName);
getRepoInfo(instanceUrl, Authorization.returnAuthentication(ctx, loginUid, instanceToken), repositoryOwner, repositoryName);
} }
} }
@ -293,27 +260,34 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
int id = item.getItemId(); int id = item.getItemId();
switch(id) { switch(id) {
case android.R.id.home: case android.R.id.home:
finish(); finish();
return true; return true;
case R.id.repoMenu: case R.id.repoMenu:
BottomSheetRepoFragment bottomSheet = new BottomSheetRepoFragment(); BottomSheetRepoFragment bottomSheet = new BottomSheetRepoFragment();
bottomSheet.show(getSupportFragmentManager(), "repoBottomSheet"); bottomSheet.show(getSupportFragmentManager(), "repoBottomSheet");
return true; return true;
case R.id.filter: case R.id.filter:
BottomSheetIssuesFilterFragment filterBottomSheet = new BottomSheetIssuesFilterFragment(); BottomSheetIssuesFilterFragment filterBottomSheet = new BottomSheetIssuesFilterFragment();
filterBottomSheet.show(getSupportFragmentManager(), "repoFilterMenuBottomSheet"); filterBottomSheet.show(getSupportFragmentManager(), "repoFilterMenuBottomSheet");
return true; return true;
case R.id.filterPr: case R.id.filterPr:
BottomSheetPullRequestFilterFragment filterPrBottomSheet = new BottomSheetPullRequestFilterFragment(); BottomSheetPullRequestFilterFragment filterPrBottomSheet = new BottomSheetPullRequestFilterFragment();
filterPrBottomSheet.show(getSupportFragmentManager(), "repoFilterMenuPrBottomSheet"); filterPrBottomSheet.show(getSupportFragmentManager(), "repoFilterMenuPrBottomSheet");
return true; return true;
case R.id.filterMilestone: case R.id.filterMilestone:
BottomSheetMilestonesFilterFragment filterMilestoneBottomSheet = new BottomSheetMilestonesFilterFragment(); BottomSheetMilestonesFilterFragment filterMilestoneBottomSheet = new BottomSheetMilestonesFilterFragment();
filterMilestoneBottomSheet.show(getSupportFragmentManager(), "repoFilterMenuMilestoneBottomSheet"); filterMilestoneBottomSheet.show(getSupportFragmentManager(), "repoFilterMenuMilestoneBottomSheet");
return true; return true;
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
} }
@ -321,68 +295,81 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
@Override @Override
public void onButtonClicked(String text) { public void onButtonClicked(String text) {
TinyDB tinyDb = new TinyDB(appCtx);
switch(text) { switch(text) {
case "label": case "label":
startActivity(new Intent(RepoDetailActivity.this, CreateLabelActivity.class)); startActivity(new Intent(RepoDetailActivity.this, CreateLabelActivity.class));
break; break;
case "newIssue": case "newIssue":
startActivity(new Intent(RepoDetailActivity.this, CreateIssueActivity.class)); startActivity(new Intent(RepoDetailActivity.this, CreateIssueActivity.class));
break; break;
case "newMilestone": case "newMilestone":
startActivity(new Intent(RepoDetailActivity.this, CreateMilestoneActivity.class)); startActivity(new Intent(RepoDetailActivity.this, CreateMilestoneActivity.class));
break; break;
case "addCollaborator": case "addCollaborator":
startActivity(new Intent(RepoDetailActivity.this, AddCollaboratorToRepositoryActivity.class)); startActivity(new Intent(RepoDetailActivity.this, AddCollaboratorToRepositoryActivity.class));
break; break;
case "createRelease": case "createRelease":
startActivity(new Intent(RepoDetailActivity.this, CreateReleaseActivity.class)); startActivity(new Intent(RepoDetailActivity.this, CreateReleaseActivity.class));
break; break;
case "openWebRepo": case "openWebRepo":
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(tinyDb.getString("repoHtmlUrl"))); Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(tinyDB.getString("repoHtmlUrl")));
startActivity(i); startActivity(i);
break; break;
case "shareRepo": case "shareRepo":
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND); Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain"); sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, tinyDb.getString("repoHtmlUrl")); sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, tinyDB.getString("repoHtmlUrl"));
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, tinyDb.getString("repoHtmlUrl")); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, tinyDB.getString("repoHtmlUrl"));
startActivity(Intent.createChooser(sharingIntent, tinyDb.getString("repoHtmlUrl"))); startActivity(Intent.createChooser(sharingIntent, tinyDB.getString("repoHtmlUrl")));
break; break;
case "newFile": case "newFile":
startActivity(new Intent(RepoDetailActivity.this, CreateFileActivity.class)); startActivity(new Intent(RepoDetailActivity.this, CreateFileActivity.class));
break; break;
case "openIssues": case "openIssues":
if(getFragmentRefreshListener() != null) { if(getFragmentRefreshListener() != null) {
getFragmentRefreshListener().onRefresh("open"); getFragmentRefreshListener().onRefresh("open");
} }
break; break;
case "closedIssues": case "closedIssues":
if(getFragmentRefreshListener() != null) { if(getFragmentRefreshListener() != null) {
getFragmentRefreshListener().onRefresh("closed"); getFragmentRefreshListener().onRefresh("closed");
} }
break; break;
case "openPr": case "openPr":
if(getFragmentRefreshListenerPr() != null) { if(getFragmentRefreshListenerPr() != null) {
getFragmentRefreshListenerPr().onRefresh("open"); getFragmentRefreshListenerPr().onRefresh("open");
} }
break; break;
case "closedPr": case "closedPr":
if(getFragmentRefreshListenerPr() != null) { if(getFragmentRefreshListenerPr() != null) {
getFragmentRefreshListenerPr().onRefresh("closed"); getFragmentRefreshListenerPr().onRefresh("closed");
} }
break; break;
case "openMilestone": case "openMilestone":
if(getFragmentRefreshListenerMilestone() != null) { if(getFragmentRefreshListenerMilestone() != null) {
getFragmentRefreshListenerMilestone().onRefresh("open"); getFragmentRefreshListenerMilestone().onRefresh("open");
} }
break; break;
case "closedMilestone": case "closedMilestone":
if(getFragmentRefreshListenerMilestone() != null) { if(getFragmentRefreshListenerMilestone() != null) {
getFragmentRefreshListenerMilestone().onRefresh("closed"); getFragmentRefreshListenerMilestone().onRefresh("closed");
} }
break; break;
} }
} }
@ -398,54 +385,58 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
@Override @Override
public Fragment getItem(int position) { public Fragment getItem(int position) {
TinyDB tinyDb = new TinyDB(appCtx);
String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/");
String repoOwner = parts[0];
String repoName = parts[1];
Fragment fragment = null; Fragment fragment = null;
switch(position) { switch(position) {
case 0: // information
return RepoInfoFragment.newInstance(repoOwner, repoName); case 0: // Repository details
case 1: // files return RepoInfoFragment.newInstance(repositoryOwner, repositoryName);
return FilesFragment.newInstance(repoOwner, repoName);
case 2: // issues case 1: // Files
return FilesFragment.newInstance(repositoryOwner, repositoryName);
case 2: // Issues
fragment = new IssuesFragment(); fragment = new IssuesFragment();
break; break;
case 3: // pull requests
case 3: // Pull requests
fragment = new PullRequestsFragment(); fragment = new PullRequestsFragment();
break; break;
case 4: // branches
return BranchesFragment.newInstance(repoOwner, repoName); case 4: // Branches
case 5: // releases return BranchesFragment.newInstance(repositoryOwner, repositoryName);
return ReleasesFragment.newInstance(repoOwner, repoName);
case 6: // milestones case 5: // Releases
return ReleasesFragment.newInstance(repositoryOwner, repositoryName);
case 6: // Milestones
fragment = new MilestonesFragment(); fragment = new MilestonesFragment();
break; break;
case 7: // labels
return LabelsFragment.newInstance(repoOwner, repoName); case 7: // Labels
case 8: // collaborators return LabelsFragment.newInstance(repositoryOwner, repositoryName);
return CollaboratorsFragment.newInstance(repoOwner, repoName);
case 8: // Collaborators
return CollaboratorsFragment.newInstance(repositoryOwner, repositoryName);
} }
assert fragment != null; assert fragment != null;
return fragment; return fragment;
} }
@Override @Override
public int getCount() { public int getCount() {
return 9; return tabsCount;
} }
} }
private void getRepoInfo(String instanceUrl, String token, final String owner, String repo) { private void getRepoInfo(String instanceUrl, String token, final String owner, String repo) {
TinyDB tinyDb = new TinyDB(appCtx);
Call<UserRepositories> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getUserRepository(token, owner, repo); Call<UserRepositories> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getUserRepository(token, owner, repo);
call.enqueue(new Callback<UserRepositories>() { call.enqueue(new Callback<UserRepositories>() {
@Override @Override
@ -457,20 +448,23 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
if(response.code() == 200) { if(response.code() == 200) {
if(tinyDb.getBoolean("enableCounterBadges")) { if(tinyDB.getBoolean("enableCounterBadges")) {
assert repoInfo != null; assert repoInfo != null;
if(repoInfo.getOpen_issues_count() != null) { if(repoInfo.getOpen_issues_count() != null) {
textViewBadgeIssue.setVisibility(View.VISIBLE); textViewBadgeIssue.setVisibility(View.VISIBLE);
textViewBadgeIssue.setText(repoInfo.getOpen_issues_count()); textViewBadgeIssue.setText(repoInfo.getOpen_issues_count());
} }
if(repoInfo.getOpen_pull_count() != null) { if(repoInfo.getOpen_pull_count() != null) {
textViewBadgePull.setVisibility(View.VISIBLE); textViewBadgePull.setVisibility(View.VISIBLE);
textViewBadgePull.setText(repoInfo.getOpen_pull_count()); textViewBadgePull.setText(repoInfo.getOpen_pull_count());
} }
if(repoInfo.getRelease_count() != null) { if(repoInfo.getRelease_count() != null) {
textViewBadgeRelease.setVisibility(View.VISIBLE); textViewBadgeRelease.setVisibility(View.VISIBLE);
textViewBadgeRelease.setText(repoInfo.getRelease_count()); textViewBadgeRelease.setText(repoInfo.getRelease_count());
} }
@ -480,6 +474,7 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
} }
else { else {
Log.e("onFailure", String.valueOf(response.code())); Log.e("onFailure", String.valueOf(response.code()));
} }
@ -497,17 +492,13 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
private void checkRepositoryStarStatus(String instanceUrl, String instanceToken, final String owner, String repo) { private void checkRepositoryStarStatus(String instanceUrl, String instanceToken, final String owner, String repo) {
Call<JsonElement> call; Call<JsonElement> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().checkRepoStarStatus(instanceToken, owner, repo);
call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().checkRepoStarStatus(instanceToken, owner, repo);
call.enqueue(new Callback<JsonElement>() { call.enqueue(new Callback<JsonElement>() {
@Override @Override
public void onResponse(@NonNull Call<JsonElement> call, @NonNull retrofit2.Response<JsonElement> response) { public void onResponse(@NonNull Call<JsonElement> call, @NonNull retrofit2.Response<JsonElement> response) {
TinyDB tinyDb = new TinyDB(appCtx); tinyDB.putInt("repositoryStarStatus", response.code());
tinyDb.putInt("repositoryStarStatus", response.code());
} }
@ -525,22 +516,23 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
Call<WatchInfo> call; Call<WatchInfo> call;
call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().checkRepoWatchStatus(instanceToken, owner, repo); call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().checkRepoWatchStatus(instanceToken, owner, repo);
call.enqueue(new Callback<WatchInfo>() { call.enqueue(new Callback<WatchInfo>() {
@Override @Override
public void onResponse(@NonNull Call<WatchInfo> call, @NonNull retrofit2.Response<WatchInfo> response) { public void onResponse(@NonNull Call<WatchInfo> call, @NonNull retrofit2.Response<WatchInfo> response) {
TinyDB tinyDb = new TinyDB(appCtx);
if(response.code() == 200) { if(response.code() == 200) {
assert response.body() != null; assert response.body() != null;
if(response.body().getSubscribed()) { if(response.body().getSubscribed()) {
tinyDb.putBoolean("repositoryWatchStatus", true); tinyDB.putBoolean("repositoryWatchStatus", true);
} }
} }
else { else {
tinyDb.putBoolean("repositoryWatchStatus", false);
tinyDB.putBoolean("repositoryWatchStatus", false);
} }
} }
@ -554,4 +546,25 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
} }
// Issues interface
public FragmentRefreshListener getFragmentRefreshListener() { return fragmentRefreshListener; }
public void setFragmentRefreshListener(FragmentRefreshListener fragmentRefreshListener) { this.fragmentRefreshListener = fragmentRefreshListener; }
public interface FragmentRefreshListener { void onRefresh(String text); }
// Pull request interface
public FragmentRefreshListenerPr getFragmentRefreshListenerPr() { return fragmentRefreshListenerPr; }
public void setFragmentRefreshListenerPr(FragmentRefreshListenerPr fragmentRefreshListenerPr) { this.fragmentRefreshListenerPr = fragmentRefreshListenerPr; }
public interface FragmentRefreshListenerPr { void onRefresh(String text); }
// Milestones interface
public FragmentRefreshListenerMilestone getFragmentRefreshListenerMilestone() { return fragmentRefreshListenerMilestone; }
public void setFragmentRefreshListenerMilestone(FragmentRefreshListenerMilestone fragmentRefreshListenerMilestone) { this.fragmentRefreshListenerMilestone = fragmentRefreshListenerMilestone; }
public interface FragmentRefreshListenerMilestone { void onRefresh(String text); }
} }

View File

@ -59,6 +59,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
private TextView repoStars; private TextView repoStars;
private TextView repoForks; private TextView repoForks;
private TextView repoOpenIssuesCount; private TextView repoOpenIssuesCount;
private TextView repoType;
private LinearLayout archiveRepo; private LinearLayout archiveRepo;
private ReposSearchViewHolder(View itemView) { private ReposSearchViewHolder(View itemView) {
@ -75,6 +76,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
repoForks = itemView.findViewById(R.id.repoForks); repoForks = itemView.findViewById(R.id.repoForks);
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount); repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu); ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
repoType = itemView.findViewById(R.id.repoType);
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame); archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
itemView.setOnClickListener(v -> { itemView.setOnClickListener(v -> {
@ -153,7 +155,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
TextView repoWatchers = view.findViewById(R.id.repoWatchers); TextView repoWatchers = view.findViewById(R.id.repoWatchers);
TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader); TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader);
bottomSheetHeader.setText(fullName.getText()); bottomSheetHeader.setText(String.format("%s / %s", fullName.getText().toString().split("/")[0], fullName.getText().toString().split("/")[1]));
BottomSheetDialog dialog = new BottomSheetDialog(context); BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view); dialog.setContentView(view);
dialog.show(); dialog.show();
@ -233,9 +235,11 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
holder.fullName.setText(currentItem.getFullname()); holder.fullName.setText(currentItem.getFullname());
if(currentItem.getPrivateFlag()) { if(currentItem.getPrivateFlag()) {
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock_bold); holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock_bold);
holder.repoType.setText(R.string.strPrivate);
} }
else { else {
holder.repoPrivatePublic.setImageResource(R.drawable.ic_public); holder.repoPrivatePublic.setImageResource(R.drawable.ic_public);
holder.repoType.setText(R.string.strPublic);
} }
holder.repoStars.setText(currentItem.getStars_count()); holder.repoStars.setText(currentItem.getStars_count());
holder.repoForks.setText(currentItem.getForks_count()); holder.repoForks.setText(currentItem.getForks_count());

View File

@ -1,6 +1,8 @@
package org.mian.gitnex.adapters; package org.mian.gitnex.adapters;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -104,6 +106,8 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
TextView commentMenuEdit = view.findViewById(R.id.commentMenuEdit); TextView commentMenuEdit = view.findViewById(R.id.commentMenuEdit);
TextView commentShare = view.findViewById(R.id.issueCommentShare); TextView commentShare = view.findViewById(R.id.issueCommentShare);
TextView commentMenuQuote = view.findViewById(R.id.commentMenuQuote);
TextView commentMenuCopy = view.findViewById(R.id.commentMenuCopy);
TextView commentMenuDelete = view.findViewById(R.id.commentMenuDelete); TextView commentMenuDelete = view.findViewById(R.id.commentMenuDelete);
if(!loginUid.contentEquals(commenterUsername.getText())) { if(!loginUid.contentEquals(commenterUsername.getText())) {
@ -111,6 +115,10 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
commentMenuDelete.setVisibility(View.GONE); commentMenuDelete.setVisibility(View.GONE);
} }
if(issueComment.getText().toString().isEmpty()) {
commentMenuCopy.setVisibility(View.GONE);
}
BottomSheetDialog dialog = new BottomSheetDialog(ctx); BottomSheetDialog dialog = new BottomSheetDialog(ctx);
dialog.setContentView(view); dialog.setContentView(view);
dialog.show(); dialog.show();
@ -143,6 +151,48 @@ public class IssueCommentsAdapter extends RecyclerView.Adapter<IssueCommentsAdap
}); });
commentMenuQuote.setOnClickListener(v1 -> {
StringBuilder stringBuilder = new StringBuilder();
String commenterName = commenterUsername.getText().toString();
if(!commenterName.equals(tinyDb.getString("userLogin"))) {
stringBuilder.append("@").append(commenterName).append("\n\n");
}
String[] lines = commendBodyRaw.getText().toString().split("\\R");
for(String line : lines) {
stringBuilder.append(">").append(line).append("\n");
}
stringBuilder.append("\n");
Intent intent = new Intent(ctx, ReplyToIssueActivity.class);
intent.putExtra("commentBody", stringBuilder.toString());
intent.putExtra("cursorToEnd", true);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
dialog.dismiss();
ctx.startActivity(intent);
});
commentMenuCopy.setOnClickListener(view1 -> {
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(Context.CLIPBOARD_SERVICE);
assert clipboard != null;
ClipData clip = ClipData.newPlainText("Comment on issue #" + issueNumber.getText().toString(), issueComment.getText().toString());
clipboard.setPrimaryClip(clip);
dialog.dismiss();
Toasty.info(ctx, ctx.getString(R.string.copyIssueCommentToastMsg));
});
commentMenuDelete.setOnClickListener(deleteComment -> { commentMenuDelete.setOnClickListener(deleteComment -> {
deleteIssueComment(ctx, Integer.parseInt(commendId.getText().toString()), getAdapterPosition()); deleteIssueComment(ctx, Integer.parseInt(commendId.getText().toString()), getAdapterPosition());

View File

@ -3,26 +3,25 @@ package org.mian.gitnex.adapters;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Typeface;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.amulyakhare.textdrawable.TextDrawable; import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.core.widget.ImageViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.bottomsheet.BottomSheetDialog;
import org.mian.gitnex.R; import org.mian.gitnex.R;
import org.mian.gitnex.activities.CreateLabelActivity; import org.mian.gitnex.activities.CreateLabelActivity;
import org.mian.gitnex.helpers.AlertDialogs; import org.mian.gitnex.helpers.AlertDialogs;
import org.mian.gitnex.helpers.ColorInverter; import org.mian.gitnex.helpers.ColorInverter;
import org.mian.gitnex.helpers.LabelWidthCalculator;
import org.mian.gitnex.models.Labels; import org.mian.gitnex.models.Labels;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
/** /**
* Author M M Arif * Author M M Arif
@ -39,12 +38,17 @@ public class LabelsAdapter extends RecyclerView.Adapter<LabelsAdapter.LabelsView
private TextView labelTitle; private TextView labelTitle;
private TextView labelId; private TextView labelId;
private TextView labelColor; private TextView labelColor;
private ImageView labelsView;
private CardView labelView;
private ImageView labelIcon;
private TextView labelName;
private LabelsViewHolder(View itemView) { private LabelsViewHolder(View itemView) {
super(itemView); super(itemView);
labelsView = itemView.findViewById(R.id.labelsView); labelView = itemView.findViewById(R.id.labelView);
labelIcon = itemView.findViewById(R.id.labelIcon);
labelName = itemView.findViewById(R.id.labelName);
ImageView labelsOptionsMenu = itemView.findViewById(R.id.labelsOptionsMenu); ImageView labelsOptionsMenu = itemView.findViewById(R.id.labelsOptionsMenu);
labelTitle = itemView.findViewById(R.id.labelTitle); labelTitle = itemView.findViewById(R.id.labelTitle);
labelId = itemView.findViewById(R.id.labelId); labelId = itemView.findViewById(R.id.labelId);
@ -119,19 +123,13 @@ public class LabelsAdapter extends RecyclerView.Adapter<LabelsAdapter.LabelsView
String labelName = currentItem.getName(); String labelName = currentItem.getName();
int color = Color.parseColor("#" + labelColor); int color = Color.parseColor("#" + labelColor);
int contrastColor = new ColorInverter().getContrastColor(color);
TextDrawable drawable = TextDrawable.builder() ImageViewCompat.setImageTintList(holder.labelIcon, ColorStateList.valueOf(contrastColor));
.beginConfig()
.useFont(Typeface.DEFAULT)
.bold()
.textColor(new ColorInverter().getContrastColor(color))
.fontSize(35)
.width(LabelWidthCalculator.calculateLabelWidth(labelName, Typeface.DEFAULT, 40, 20))
.height(55)
.endConfig()
.buildRoundRect(labelName, color, 10);
holder.labelsView.setImageDrawable(drawable); holder.labelName.setTextColor(contrastColor);
holder.labelName.setText(labelName);
holder.labelView.setCardBackgroundColor(color);
} }
@ -140,4 +138,4 @@ public class LabelsAdapter extends RecyclerView.Adapter<LabelsAdapter.LabelsView
return labelsList.size(); return labelsList.size();
} }
} }

View File

@ -151,7 +151,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
TextView repoWatchers = view.findViewById(R.id.repoWatchers); TextView repoWatchers = view.findViewById(R.id.repoWatchers);
TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader); TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader);
bottomSheetHeader.setText(repoFullName.getText()); bottomSheetHeader.setText(String.format("%s / %s", repoFullName.getText().toString().split("/")[0], repoFullName.getText().toString().split("/")[1]));
BottomSheetDialog dialog = new BottomSheetDialog(context); BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view); dialog.setContentView(view);
dialog.show(); dialog.show();

View File

@ -190,8 +190,15 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
prMergeable.setText(String.valueOf(prModel.isMergeable())); prMergeable.setText(String.valueOf(prModel.isMergeable()));
if(prModel.getHead() != null) { if(prModel.getHead() != null) {
prHeadBranch.setText(prModel.getHead().getRef()); prHeadBranch.setText(prModel.getHead().getRef());
prIsFork.setText(String.valueOf(prModel.getHead().getRepo().isFork())); if(prModel.getHead().getRepo() != null) {
prForkFullName.setText(prModel.getHead().getRepo().getFull_name()); prIsFork.setText(String.valueOf(prModel.getHead().getRepo().isFork()));
prForkFullName.setText(prModel.getHead().getRepo().getFull_name());
}
else {
// pull was done from a deleted fork
prIsFork.setText("true");
prForkFullName.setText(context.getString(R.string.prDeletedFrok));
}
} }
prCommentsCount.setText(String.valueOf(prModel.getComments())); prCommentsCount.setText(String.valueOf(prModel.getComments()));

View File

@ -203,7 +203,7 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
markwon.setParsedMarkdown(holder.releaseBodyContent, bodyWithMD); markwon.setParsedMarkdown(holder.releaseBodyContent, bodyWithMD);
} }
else { else {
holder.releaseBodyContent.setVisibility(View.GONE); holder.releaseBodyContent.setText(R.string.noReleaseBodyContent);
} }
holder.downloadFrame.setOnClickListener(v -> { holder.downloadFrame.setOnClickListener(v -> {

View File

@ -153,7 +153,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
TextView repoWatchers = view.findViewById(R.id.repoWatchers); TextView repoWatchers = view.findViewById(R.id.repoWatchers);
TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader); TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader);
bottomSheetHeader.setText(fullName.getText()); bottomSheetHeader.setText(String.format("%s / %s", fullName.getText().toString().split("/")[0], fullName.getText().toString().split("/")[1]));
BottomSheetDialog dialog = new BottomSheetDialog(context); BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view); dialog.setContentView(view);
dialog.show(); dialog.show();

View File

@ -150,7 +150,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
TextView repoWatchers = view.findViewById(R.id.repoWatchers); TextView repoWatchers = view.findViewById(R.id.repoWatchers);
TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader); TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader);
bottomSheetHeader.setText(fullName.getText()); bottomSheetHeader.setText(String.format("%s / %s", fullName.getText().toString().split("/")[0], fullName.getText().toString().split("/")[1]));
BottomSheetDialog dialog = new BottomSheetDialog(context); BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view); dialog.setContentView(view);
dialog.show(); dialog.show();

View File

@ -151,7 +151,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
TextView repoWatchers = view.findViewById(R.id.repoWatchers); TextView repoWatchers = view.findViewById(R.id.repoWatchers);
TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader); TextView bottomSheetHeader = view.findViewById(R.id.bottomSheetHeader);
bottomSheetHeader.setText(fullName.getText()); bottomSheetHeader.setText(String.format("%s / %s", fullName.getText().toString().split("/")[0], fullName.getText().toString().split("/")[1]));
BottomSheetDialog dialog = new BottomSheetDialog(context); BottomSheetDialog dialog = new BottomSheetDialog(context);
dialog.setContentView(view); dialog.setContentView(view);
dialog.show(); dialog.show();

View File

@ -104,12 +104,11 @@ public class UserSearchForTeamMemberAdapter extends RecyclerView.Adapter<UserSea
if (!currentItem.getFullname().equals("")) { if (!currentItem.getFullname().equals("")) {
holder.userFullName.setText(currentItem.getFullname()); holder.userFullName.setText(currentItem.getFullname());
holder.userName.setText(mCtx.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
} }
else { else {
holder.userFullName.setText(mCtx.getResources().getString(R.string.usernameWithAt, currentItem.getLogin())); holder.userFullName.setText(mCtx.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
holder.userName.setText(mCtx.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
} }
holder.userName.setText(mCtx.getResources().getString(R.string.usernameWithAt, currentItem.getLogin()));
if (!currentItem.getAvatar().equals("")) { if (!currentItem.getAvatar().equals("")) {
PicassoService.getInstance(mCtx).get().load(currentItem.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.userAvatar); PicassoService.getInstance(mCtx).get().load(currentItem.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.userAvatar);
@ -123,7 +122,6 @@ public class UserSearchForTeamMemberAdapter extends RecyclerView.Adapter<UserSea
String repoFullName = tinyDb.getString("repoFullName"); String repoFullName = tinyDb.getString("repoFullName");
String[] parts = repoFullName.split("/"); String[] parts = repoFullName.split("/");
final String repoOwner = parts[0]; final String repoOwner = parts[0];
final String repoName = parts[1];
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token"); final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
Call<UserInfo> call = RetrofitClient Call<UserInfo> call = RetrofitClient

View File

@ -27,7 +27,7 @@ public class AppApiService {
public static <S> S createService(Class<S> serviceClass, String instanceURL, Context ctx) { public static <S> S createService(Class<S> serviceClass, String instanceURL, Context ctx) {
TinyDB tinyDb = new TinyDB(ctx); TinyDB tinyDb = new TinyDB(ctx);
final boolean connToInternet = AppUtil.haveNetworkConnection(ctx); final boolean connToInternet = AppUtil.hasNetworkConnection(ctx);
File httpCacheDirectory = new File(ctx.getCacheDir(), "responses"); File httpCacheDirectory = new File(ctx.getCacheDir(), "responses");
int cacheSize = FilesData.returnOnlyNumber(tinyDb.getString("cacheSizeStr")) * 1024 * 1024; int cacheSize = FilesData.returnOnlyNumber(tinyDb.getString("cacheSizeStr")) * 1024 * 1024;
Cache cache = new Cache(httpCacheDirectory, cacheSize); Cache cache = new Cache(httpCacheDirectory, cacheSize);

View File

@ -32,7 +32,7 @@ public class RetrofitClient {
private RetrofitClient(String instanceUrl, Context ctx) { private RetrofitClient(String instanceUrl, Context ctx) {
TinyDB tinyDb = new TinyDB(ctx); TinyDB tinyDb = new TinyDB(ctx);
final boolean connToInternet = AppUtil.haveNetworkConnection(ctx); final boolean connToInternet = AppUtil.hasNetworkConnection(ctx);
int cacheSize = FilesData.returnOnlyNumber(tinyDb.getString("cacheSizeStr")) * 1024 * 1024; int cacheSize = FilesData.returnOnlyNumber(tinyDb.getString("cacheSizeStr")) * 1024 * 1024;
File httpCacheDirectory = new File(ctx.getCacheDir(), "responses"); File httpCacheDirectory = new File(ctx.getCacheDir(), "responses");
Cache cache = new Cache(httpCacheDirectory, cacheSize); Cache cache = new Cache(httpCacheDirectory, cacheSize);

View File

@ -71,13 +71,14 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
} }
}); });
addCollaborator.setOnClickListener(new View.OnClickListener() { if (tinyDb.getBoolean("isRepoAdmin")) {
@Override addCollaborator.setOnClickListener(v1 -> {
public void onClick(View v) { bmListener.onButtonClicked("addCollaborator");
bmListener.onButtonClicked("addCollaborator"); dismiss();
dismiss(); });
} } else {
}); addCollaborator.setVisibility(View.GONE);
}
createRelease.setOnClickListener(new View.OnClickListener() { createRelease.setOnClickListener(new View.OnClickListener() {
@Override @Override

View File

@ -19,10 +19,14 @@ import org.mian.gitnex.activities.AddRemoveLabelsActivity;
import org.mian.gitnex.activities.EditIssueActivity; import org.mian.gitnex.activities.EditIssueActivity;
import org.mian.gitnex.activities.FileDiffActivity; import org.mian.gitnex.activities.FileDiffActivity;
import org.mian.gitnex.activities.MergePullRequestActivity; import org.mian.gitnex.activities.MergePullRequestActivity;
import org.mian.gitnex.helpers.PathsHelper;
import org.mian.gitnex.helpers.Toasty; import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.helpers.Version; import org.mian.gitnex.helpers.Version;
import org.mian.gitnex.util.TinyDB; import org.mian.gitnex.util.TinyDB;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Objects; import java.util.Objects;
import io.mikael.urlbuilder.UrlBuilder;
/** /**
* Author M M Arif * Author M M Arif
@ -138,53 +142,61 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
shareIssue.setOnClickListener(v1 -> { shareIssue.setOnClickListener(v1 -> {
// get url of repo try {
String repoFullName = tinyDB.getString("repoFullName");
String instanceUrlWithProtocol = "https://" + tinyDB.getString("instanceUrlRaw"); URI instanceUrl = new URI(tinyDB.getString("instanceUrlWithProtocol"));
if(!tinyDB.getString("instanceUrlWithProtocol").isEmpty()) {
instanceUrlWithProtocol = tinyDB.getString("instanceUrlWithProtocol"); String issuePath = PathsHelper.join(instanceUrl.getPath(), tinyDB.getString("repoFullName"), "/issues/", tinyDB.getString("issueNumber"));
String issueUrl = UrlBuilder.fromUri(instanceUrl)
.withPath(issuePath)
.toString();
// share issue
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.hash) + tinyDB.getString("issueNumber") + " " + tinyDB.getString("issueTitle"));
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, issueUrl);
startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.hash) + tinyDB.getString("issueNumber") + " " + tinyDB.getString("issueTitle")));
}
catch(URISyntaxException e) {
Toasty.error(ctx, getString(R.string.genericError));
}
finally {
dismiss();
} }
// get issue Url
String issueUrl = instanceUrlWithProtocol + "/" + repoFullName + "/issues/" + tinyDB.getString("issueNumber");
// share issue
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.hash) + tinyDB.getString("issueNumber") + " " + tinyDB.getString("issueTitle"));
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, issueUrl);
startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.hash) + tinyDB.getString("issueNumber") + " " + tinyDB.getString("issueTitle")));
dismiss();
}); });
copyIssueUrl.setOnClickListener(new View.OnClickListener() { copyIssueUrl.setOnClickListener(v12 -> {
@Override try {
public void onClick(View v) {
// get url of repo URI instanceUrl = new URI(tinyDB.getString("instanceUrlWithProtocol"));
String repoFullName = tinyDB.getString("repoFullName");
String instanceUrlWithProtocol = "https://" + tinyDB.getString("instanceUrlRaw");
if(!tinyDB.getString("instanceUrlWithProtocol").isEmpty()) {
instanceUrlWithProtocol = tinyDB.getString("instanceUrlWithProtocol");
}
// get issue Url String issuePath = PathsHelper.join(instanceUrl.getPath(), tinyDB.getString("repoFullName"), "/issues/", tinyDB.getString("issueNumber"));
String issueUrl = instanceUrlWithProtocol + "/" + repoFullName + "/issues/" + tinyDB.getString("issueNumber");
String issueUrl = UrlBuilder.fromUri(instanceUrl)
.withPath(issuePath)
.toString();
// copy to clipboard // copy to clipboard
ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(android.content.Context.CLIPBOARD_SERVICE); ClipboardManager clipboard = (ClipboardManager) Objects.requireNonNull(ctx).getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("issueUrl", issueUrl); ClipData clip = ClipData.newPlainText("issueUrl", issueUrl);
assert clipboard != null; assert clipboard != null;
clipboard.setPrimaryClip(clip); clipboard.setPrimaryClip(clip);
dismiss();
Toasty.info(ctx, ctx.getString(R.string.copyIssueUrlToastMsg)); Toasty.info(ctx, ctx.getString(R.string.copyIssueUrlToastMsg));
} }
catch(URISyntaxException e) {
Toasty.error(ctx, getString(R.string.genericError));
}
finally {
dismiss();
}
}); });
if(tinyDB.getString("issueType").equals("issue")) { if(tinyDB.getString("issueType").equals("issue")) {

View File

@ -325,6 +325,9 @@ public class IssuesFragment extends Fragment {
List<Issues> arr = new ArrayList<>(); List<Issues> arr = new ArrayList<>();
for(Issues d : issuesList) { for(Issues d : issuesList) {
if(d == null || d.getTitle() == null || d.getBody() == null) {
continue;
}
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) { if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) {
arr.add(d); arr.add(d);
} }

View File

@ -104,7 +104,7 @@ public class MembersByOrgFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -318,6 +318,9 @@ public class MilestonesFragment extends Fragment {
List<Milestones> arr = new ArrayList<>(); List<Milestones> arr = new ArrayList<>();
for(Milestones d : dataList) { for(Milestones d : dataList) {
if(d == null || d.getTitle() == null || d.getDescription() == null) {
continue;
}
if(d.getTitle().toLowerCase().contains(text) || d.getDescription().toLowerCase().contains(text)) { if(d.getTitle().toLowerCase().contains(text) || d.getDescription().toLowerCase().contains(text)) {
arr.add(d); arr.add(d);
} }

View File

@ -81,7 +81,7 @@ public class MyRepositoriesFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
final View v = inflater.inflate(R.layout.fragment_my_repositories, container, false); final View v = inflater.inflate(R.layout.fragment_my_repositories, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
@ -196,7 +196,7 @@ public class MyRepositoriesFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -52,7 +52,7 @@ public class OrganizationsFragment extends Fragment {
final View v = inflater.inflate(R.layout.fragment_organizations, container, false); final View v = inflater.inflate(R.layout.fragment_organizations, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
TinyDB tinyDb = new TinyDB(getContext()); TinyDB tinyDb = new TinyDB(getContext());
final String instanceUrl = tinyDb.getString("instanceUrl"); final String instanceUrl = tinyDb.getString("instanceUrl");
@ -158,7 +158,7 @@ public class OrganizationsFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -1,6 +1,7 @@
package org.mian.gitnex.fragments; package org.mian.gitnex.fragments;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -13,6 +14,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.widget.ImageViewCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter; import androidx.fragment.app.FragmentStatePagerAdapter;
@ -54,16 +56,26 @@ public class ProfileFragment extends Fragment {
ImageView userAvatarBackground = v.findViewById(R.id.userAvatarBackground); ImageView userAvatarBackground = v.findViewById(R.id.userAvatarBackground);
ImageView userAvatar = v.findViewById(R.id.userAvatar); ImageView userAvatar = v.findViewById(R.id.userAvatar);
TextView userLogin = v.findViewById(R.id.userLogin); TextView userLogin = v.findViewById(R.id.userLogin);
View divider = v.findViewById(R.id.divider);
TextView userLanguage = v.findViewById(R.id.userLanguage); TextView userLanguage = v.findViewById(R.id.userLanguage);
ImageView userLanguageIcon = v.findViewById(R.id.userLanguageIcon);
ViewGroup aboutFrame = v.findViewById(R.id.aboutFrame); ViewGroup aboutFrame = v.findViewById(R.id.aboutFrame);
String[] userLanguageCodes = tinyDb.getString("userLang").split("-"); String[] userLanguageCodes = tinyDb.getString("userLang").split("-");
Locale locale = new Locale(userLanguageCodes[0], userLanguageCodes[1]);
if(userLanguageCodes.length >= 2) {
Locale locale = new Locale(userLanguageCodes[0], userLanguageCodes[1]);
userLanguage.setText(locale.getDisplayCountry());
}
else {
userLanguage.setText(R.string.notSupported);
}
userFullName.setText(tinyDb.getString("userFullname")); userFullName.setText(tinyDb.getString("userFullname"));
userLogin.setText(getString(R.string.usernameWithAt, tinyDb.getString("userLogin"))); userLogin.setText(getString(R.string.usernameWithAt, tinyDb.getString("userLogin")));
userLanguage.setText(locale.getDisplayCountry());
PicassoService.getInstance(ctx).get() PicassoService.getInstance(ctx).get()
.load(tinyDb.getString("userAvatar")) .load(tinyDb.getString("userAvatar"))
@ -79,11 +91,14 @@ public class ProfileFragment extends Fragment {
@Override @Override
public void onSuccess() { public void onSuccess() {
int textColor = new ColorInverter().getImageViewContrastColor(userAvatarBackground); int invertedColor = new ColorInverter().getImageViewContrastColor(userAvatarBackground);
userFullName.setTextColor(textColor); userFullName.setTextColor(invertedColor);
userLogin.setTextColor(textColor); divider.setBackgroundColor(invertedColor);
userLanguage.setTextColor(textColor); userLogin.setTextColor(invertedColor);
userLanguage.setTextColor(invertedColor);
ImageViewCompat.setImageTintList(userLanguageIcon, ColorStateList.valueOf(invertedColor));
blurView.setupWith(aboutFrame) blurView.setupWith(aboutFrame)
.setBlurAlgorithm(new RenderScriptBlur(ctx)) .setBlurAlgorithm(new RenderScriptBlur(ctx))

View File

@ -332,6 +332,9 @@ public class PullRequestsFragment extends Fragment {
List<PullRequests> arr = new ArrayList<>(); List<PullRequests> arr = new ArrayList<>();
for(PullRequests d : prList) { for(PullRequests d : prList) {
if(d == null || d.getTitle() == null || d.getBody() == null) {
continue;
}
if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) { if(d.getTitle().toLowerCase().contains(text) || d.getBody().toLowerCase().contains(text)) {
arr.add(d); arr.add(d);
} }

View File

@ -152,7 +152,7 @@ public class RepositoriesByOrgFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -51,7 +51,7 @@ public class RepositoriesFragment extends Fragment {
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
final View v = inflater.inflate(R.layout.fragment_repositories, container, false); final View v = inflater.inflate(R.layout.fragment_repositories, container, false);
setHasOptionsMenu(true); setHasOptionsMenu(true);
@ -161,7 +161,7 @@ public class RepositoriesFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -78,7 +78,7 @@ public class StarredRepositoriesFragment extends Fragment {
Bundle savedInstanceState) { Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_starred_repositories, container, false); View v = inflater.inflate(R.layout.fragment_starred_repositories, container, false);
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
setHasOptionsMenu(true); setHasOptionsMenu(true);
TinyDB tinyDb = new TinyDB(getContext()); TinyDB tinyDb = new TinyDB(getContext());
@ -186,7 +186,7 @@ public class StarredRepositoriesFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -148,7 +148,7 @@ public class TeamsByOrgFragment extends Fragment {
@Override @Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
boolean connToInternet = AppUtil.haveNetworkConnection(Objects.requireNonNull(getContext())); boolean connToInternet = AppUtil.hasNetworkConnection(Objects.requireNonNull(getContext()));
inflater.inflate(R.menu.search_menu, menu); inflater.inflate(R.menu.search_menu, menu);
super.onCreateOptionsMenu(menu, inflater); super.onCreateOptionsMenu(menu, inflater);

View File

@ -19,28 +19,26 @@ public class AlertDialogs {
public static void authorizationTokenRevokedDialog(final Context context, String title, String message, String copyNegativeButton, String copyPositiveButton) { public static void authorizationTokenRevokedDialog(final Context context, String title, String message, String copyNegativeButton, String copyPositiveButton) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setCancelable(true)
.setIcon(R.drawable.ic_warning)
.setNegativeButton(copyNegativeButton, (dialog, which) -> dialog.dismiss())
.setPositiveButton(copyPositiveButton, (dialog, which) -> {
alertDialogBuilder final TinyDB tinyDb = new TinyDB(context);
.setTitle(title) tinyDb.putBoolean("loggedInMode", false);
.setMessage(message) tinyDb.remove("basicAuthPassword");
.setCancelable(true) tinyDb.putBoolean("basicAuthFlag", false);
.setIcon(R.drawable.ic_warning) Intent intent = new Intent(context, LoginActivity.class);
.setNegativeButton(copyNegativeButton, (dialog, which) -> dialog.dismiss()) context.startActivity(intent);
.setPositiveButton(copyPositiveButton, (dialog, which) -> { dialog.dismiss();
final TinyDB tinyDb = new TinyDB(context); });
tinyDb.putBoolean("loggedInMode", false);
tinyDb.remove("basicAuthPassword");
tinyDb.putBoolean("basicAuthFlag", false);
Intent intent = new Intent(context, LoginActivity.class);
context.startActivity(intent);
dialog.dismiss();
}); alertDialogBuilder.create().show();
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
} }
public static void labelDeleteDialog(final Context context, final String labelTitle, final String labelId, String title, String message, String positiveButton, String negativeButton) { public static void labelDeleteDialog(final Context context, final String labelTitle, final String labelId, String title, String message, String positiveButton, String negativeButton) {

View File

@ -33,7 +33,22 @@ public class ColorInverter {
if(imageView != null) { if(imageView != null) {
Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap(); Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
return getContrastColor(bitmap.getPixel(bitmap.getWidth() / 2, bitmap.getHeight() / 2));
int colorSum = 0;
int divisionValue = 0;
for(int height=0; height<bitmap.getHeight(); height += 10) {
for(int width=0; width<bitmap.getWidth(); width += 10) {
colorSum += bitmap.getPixel(width, height);
divisionValue++;
}
}
// Calculate average color
return getContrastColor(colorSum / divisionValue);
} }
else { else {

View File

@ -23,73 +23,4 @@ public class LabelWidthCalculator {
} }
public static int customWidth(int labelLength) {
int width = 33;
if(labelLength == 20) {
width = ((width * labelLength) - 150);
}
else if(labelLength == 19) {
width = ((width * labelLength) - 140);
}
else if(labelLength == 18) {
width = ((width * labelLength) - 130);
}
else if(labelLength == 17) {
width = ((width * labelLength) - 120);
}
else if(labelLength == 16) {
width = ((width * labelLength) - 110);
}
else if(labelLength == 15) {
width = ((width * labelLength) - 100);
}
else if(labelLength == 14) {
width = ((width * labelLength) - 90);
}
else if(labelLength == 13) {
width = ((width * labelLength) - 80);
}
else if(labelLength == 12) {
width = ((width * labelLength) - 70);
}
else if(labelLength == 11) {
width = ((width * labelLength) - 60);
}
else if(labelLength == 10) {
width = ((width * labelLength) - 50);
}
else if(labelLength == 9) {
width = ((width * labelLength) - 40);
}
else if(labelLength == 8) {
width = ((width * labelLength) - 30);
}
else if(labelLength == 7) {
width = ((width * labelLength) - 20);
}
else if(labelLength == 6) {
width = ((width * labelLength) - 10);
}
else if(labelLength == 5) {
width = ((width * labelLength) - 10);
}
else if(labelLength == 4) {
width = ((width * labelLength) - 10);
}
else if(labelLength == 3) {
width = ((width * labelLength) - 10);
}
else if(labelLength == 2) {
width = ((width * labelLength));
}
else {
width = (width * labelLength - 5);
}
return width;
}
} }

View File

@ -0,0 +1,37 @@
package org.mian.gitnex.helpers;
/**
* Author opyale
*/
public class PathsHelper {
public static String join(String... paths) {
StringBuilder stringBuilder = new StringBuilder();
for(String path : paths) {
if(path != null && !path.isEmpty()) {
if(!path.startsWith("/")) {
stringBuilder.append("/");
}
if(path.endsWith("/")) {
path = path.substring(0, path.lastIndexOf("/"));
}
stringBuilder.append(path);
}
}
return stringBuilder.append("/").toString();
}
}

View File

@ -17,7 +17,7 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
/** /**
* Author anonTree1417 * Author opyale
*/ */
public class PicassoCache implements Cache { public class PicassoCache implements Cache {

View File

@ -13,34 +13,34 @@ import org.mian.gitnex.R;
public class Toasty { public class Toasty {
public static void info(Context context, String message) { public static void info(Context context, String message) {
LayoutInflater inflater = LayoutInflater.from(context); LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate( context.getResources().getLayout(R.layout.custom_toast), null ); View view = inflater.inflate(context.getResources().getLayout(R.layout.custom_toast), null);
TextView text = view.findViewById(R.id.toastText); TextView text = view.findViewById(R.id.toastText);
text.setText(message); text.setText(message);
Toast toast = new Toast(context); Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_LONG); toast.setDuration(Toast.LENGTH_LONG);
toast.setView(view); toast.setView(view);
toast.show(); toast.show();
} }
public static void error(Context context, String message) { public static void error(Context context, String message) {
LayoutInflater inflater = LayoutInflater.from(context); LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate( context.getResources().getLayout(R.layout.custom_toast_error), null ); View view = inflater.inflate(context.getResources().getLayout(R.layout.custom_toast_error), null);
TextView text = view.findViewById(R.id.toastText); TextView text = view.findViewById(R.id.toastText);
text.setText(message); text.setText(message);
Toast toast = new Toast(context); Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_LONG); toast.setDuration(Toast.LENGTH_LONG);
toast.setView(view); toast.setView(view);
toast.show(); toast.show();
} }
} }

View File

@ -9,34 +9,39 @@ import java.net.URISyntaxException;
public class UrlHelper { public class UrlHelper {
public static String cleanUrl(String url) { public static String cleanUrl(String url) {
URI uri = null; URI uri = null;
try { try {
uri = new URI(url); uri = new URI(url);
} catch (URISyntaxException e) { }
e.printStackTrace(); catch(URISyntaxException e) {
} e.printStackTrace();
}
assert uri != null; assert uri != null;
String urlProtocol = uri.getScheme(); String urlProtocol = uri.getScheme();
String urlHost = uri.getHost(); String urlHost = uri.getHost();
int urlPort = uri.getPort(); int urlPort = uri.getPort();
String urlFinal = null; String urlFinal = null;
if(urlPort > 0) { if(urlPort > 0) {
urlFinal = urlProtocol + "://" + urlHost + ":" + urlPort; urlFinal = urlProtocol + "://" + urlHost + ":" + urlPort;
} }
else if(urlProtocol != null) { else if(urlProtocol != null) {
urlFinal = urlProtocol + "://" + urlHost; urlFinal = urlProtocol + "://" + urlHost;
} }
else { else {
urlFinal = urlHost; urlFinal = urlHost;
} }
return urlFinal; return urlFinal;
} }
public static String fixScheme(String url, String scheme) {
return !url.matches("^(http|https)://.+$") ? scheme + "://" + url : url;
}
} }

View File

@ -1,7 +1,7 @@
package org.mian.gitnex.helpers.ssl; package org.mian.gitnex.helpers.ssl;
/** /**
* Author Georg Lukas, modified by anonTree1417 * Author Georg Lukas, modified by opyale
*/ */
class MTMDecision { class MTMDecision {

View File

@ -7,7 +7,7 @@ import android.os.Bundle;
import org.mian.gitnex.R; import org.mian.gitnex.R;
/** /**
* Author Georg Lukas, modified by anonTree1417 * Author Georg Lukas, modified by opyale
*/ */
public class MemorizingActivity extends Activity { public class MemorizingActivity extends Activity {
@ -41,4 +41,4 @@ public class MemorizingActivity extends Activity {
} }
} }

View File

@ -39,7 +39,7 @@ import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager; import javax.net.ssl.X509TrustManager;
/** /**
* Author Georg Lukas, modified by anonTree1417 * Author Georg Lukas, modified by opyale
*/ */
public class MemorizingTrustManager implements X509TrustManager { public class MemorizingTrustManager implements X509TrustManager {

View File

@ -9,6 +9,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.util.Base64; import android.util.Base64;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.View;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -28,7 +29,7 @@ public class AppUtil {
return str.replace(original, replace); return str.replace(original, replace);
} }
public static boolean haveNetworkConnection(Context context) { public static boolean hasNetworkConnection(Context context) {
boolean haveConnectedWifi = false; boolean haveConnectedWifi = false;
boolean haveConnectedMobile = false; boolean haveConnectedMobile = false;
@ -94,7 +95,7 @@ public class AppUtil {
return str.matches("^[\\w-]+$"); return str.matches("^[\\w-]+$");
} }
public Boolean checkIntegers(String str) { public static Boolean checkIntegers(String str) {
return str.matches("\\d+"); return str.matches("\\d+");
} }
@ -116,16 +117,9 @@ public class AppUtil {
} }
public static boolean httpCheck(String url) {
String pattern = "^(http|https)://.*$";
return url.matches(pattern);
}
public static String formatFileSize(long size) { public static String formatFileSize(long size) {
String repoSize = null; String repoSize = size + " B";
double m = size / 1024.0; double m = size / 1024.0;
double g = ((size / 1024.0) / 1024.0); double g = ((size / 1024.0) / 1024.0);
@ -261,7 +255,7 @@ public class AppUtil {
public Boolean sourceCodeExtension(String ext) { public Boolean sourceCodeExtension(String ext) {
String[] extValues = new String[]{"md", "json", "java", "go", "php", "c", "cc", "cpp", "h", "cxx", "cyc", "m", "cs", "bash", "sh", "bsh", "cv", "python", "perl", "pm", "rb", "ruby", "javascript", "coffee", "rc", "rs", "rust", "basic", "clj", "css", "dart", "lisp", "erl", "hs", "lsp", "rkt", "ss", "llvm", "ll", "lua", "matlab", "pascal", "r", "scala", "sql", "latex", "tex", "vb", "vbs", "vhd", "tcl", "wiki.meta", "yaml", "yml", "markdown", "xml", "proto", "regex", "py", "pl", "js", "html", "htm", "volt", "ini", "htaccess", "conf", "gitignore", "gradle", "txt", "properties", "bat", "twig"}; String[] extValues = new String[]{"md", "json", "java", "go", "php", "c", "cc", "cpp", "h", "cxx", "cyc", "m", "cs", "bash", "sh", "bsh", "cv", "python", "perl", "pm", "rb", "ruby", "javascript", "coffee", "rc", "rs", "rust", "basic", "clj", "css", "dart", "lisp", "erl", "hs", "lsp", "rkt", "ss", "llvm", "ll", "lua", "matlab", "pascal", "r", "scala", "sql", "latex", "tex", "vb", "vbs", "vhd", "tcl", "wiki.meta", "yaml", "yml", "markdown", "xml", "proto", "regex", "py", "pl", "js", "html", "htm", "volt", "ini", "htaccess", "conf", "gitignore", "gradle", "txt", "properties", "bat", "twig", "cvs", "cmake", "in", "info", "spec", "m4", "am", "dist", "pam"};
return Arrays.asList(extValues).contains(ext); return Arrays.asList(extValues).contains(ext);
@ -297,4 +291,12 @@ public class AppUtil {
} }
public static void setMultiVisibility(int visibility, View... views) {
for(View view : views) {
view.setVisibility(visibility);
}
}
} }

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
<padding android:top="12dp" />
<solid android:color="?attr/primaryBackgroundColor" />
</shape>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,10 +27,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,10 +27,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/commentMenuDelete" android:id="@+id/commentMenuDelete"
@ -39,7 +39,31 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView
android:id="@+id/commentMenuQuote"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/menuQuoteText"
android:drawableStart="@drawable/ic_comment"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
<TextView
android:id="@+id/commentMenuCopy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/menuCopyText"
android:drawableStart="@drawable/ic_content_copy"
android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp"
android:padding="12dp" />
<TextView <TextView
android:id="@+id/issueCommentShare" android:id="@+id/issueCommentShare"
@ -51,10 +75,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/closedIssues" android:id="@+id/closedIssues"
@ -39,10 +39,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -24,10 +24,16 @@
android:text="@string/labelName" android:text="@string/labelName"
android:paddingStart="18dp" android:paddingStart="18dp"
android:paddingEnd="18dp" android:paddingEnd="18dp"
android:paddingTop="16dp" android:paddingBottom="18dp"
android:paddingBottom="16dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="18sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/divider"
android:layout_marginBottom="12dp"
android:background="?attr/dividerColor" />
<TextView <TextView
android:id="@+id/labelMenuEdit" android:id="@+id/labelMenuEdit"
@ -39,7 +45,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/labelMenuDelete" android:id="@+id/labelMenuDelete"
@ -51,10 +57,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/closedMilestone" android:id="@+id/closedMilestone"
@ -39,10 +39,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/openMilestone" android:id="@+id/openMilestone"
@ -39,10 +39,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/createTeam" android:id="@+id/createTeam"
@ -39,10 +39,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,10 +27,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,10 +27,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/closedPr" android:id="@+id/closedPr"
@ -39,10 +39,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -27,7 +27,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/createNewIssue" android:id="@+id/createNewIssue"
@ -39,7 +39,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/createNewMilestone" android:id="@+id/createNewMilestone"
@ -51,7 +51,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/createLabel" android:id="@+id/createLabel"
@ -63,7 +63,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/createRelease" android:id="@+id/createRelease"
@ -75,13 +75,13 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="12dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="12dp"
android:layout_marginStart="64dp" android:layout_marginStart="64dp"
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
@ -95,7 +95,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/starRepository" android:id="@+id/starRepository"
@ -107,7 +107,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/unStarRepository" android:id="@+id/unStarRepository"
@ -119,7 +119,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/watchRepository" android:id="@+id/watchRepository"
@ -131,7 +131,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/unWatchRepository" android:id="@+id/unWatchRepository"
@ -143,13 +143,13 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="12dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="12dp"
android:layout_marginStart="64dp" android:layout_marginStart="64dp"
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
@ -160,10 +160,10 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:drawableStart="@drawable/ic_share_24dp" android:drawableStart="@drawable/ic_share_24dp"
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:padding="16dp"
android:text="@string/shareRepository" android:text="@string/shareRepository"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp"
android:padding="12dp" />
<TextView <TextView
android:id="@+id/openWebRepo" android:id="@+id/openWebRepo"
@ -172,13 +172,13 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:drawableStart="@drawable/ic_open_in_browser" android:drawableStart="@drawable/ic_open_in_browser"
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:padding="16dp"
android:text="@string/openWebRepo" android:text="@string/openWebRepo"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp"
android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -24,10 +24,16 @@
android:text="@string/repoName" android:text="@string/repoName"
android:paddingStart="18dp" android:paddingStart="18dp"
android:paddingEnd="18dp" android:paddingEnd="18dp"
android:paddingTop="16dp" android:paddingBottom="18dp"
android:paddingBottom="16dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="18sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:id="@+id/divider"
android:layout_marginBottom="12dp"
android:background="?attr/dividerColor" />
<TextView <TextView
android:id="@+id/repoOpenInBrowser" android:id="@+id/repoOpenInBrowser"
@ -39,7 +45,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/repoStargazers" android:id="@+id/repoStargazers"
@ -51,7 +57,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/repoWatchers" android:id="@+id/repoWatchers"
@ -63,10 +69,10 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@ -4,9 +4,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="8dp" android:paddingTop="6dp"
android:background="?attr/primaryBackgroundColor" android:paddingBottom="12dp"
android:paddingTop="8dp"> android:background="?attr/primaryBackgroundColor">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -28,7 +28,7 @@
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:visibility="gone" android:visibility="gone"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/mergePullRequest" android:id="@+id/mergePullRequest"
@ -40,7 +40,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/editIssue" android:id="@+id/editIssue"
@ -52,7 +52,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/addRemoveAssignees" android:id="@+id/addRemoveAssignees"
@ -64,7 +64,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/editLabels" android:id="@+id/editLabels"
@ -76,7 +76,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/subscribeIssue" android:id="@+id/subscribeIssue"
@ -88,8 +88,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" android:padding="12dp" />
android:visibility="gone" />
<TextView <TextView
android:id="@+id/unsubscribeIssue" android:id="@+id/unsubscribeIssue"
@ -98,17 +97,17 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:drawableStart="@drawable/ic_watchers" android:drawableStart="@drawable/ic_watchers"
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:padding="16dp"
android:text="@string/singleIssueUnSubscribe" android:text="@string/singleIssueUnSubscribe"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:visibility="gone" /> android:visibility="gone"
android:padding="12dp" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="12dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="12dp"
android:layout_marginStart="64dp" android:layout_marginStart="64dp"
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
@ -119,10 +118,10 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:drawableStart="@drawable/ic_share_24dp" android:drawableStart="@drawable/ic_share_24dp"
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:padding="16dp"
android:text="@string/shareIssue" android:text="@string/shareIssue"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp"
android:padding="12dp" />
<TextView <TextView
android:id="@+id/copyIssueUrl" android:id="@+id/copyIssueUrl"
@ -131,16 +130,16 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:drawableStart="@drawable/ic_content_copy" android:drawableStart="@drawable/ic_content_copy"
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:padding="16dp"
android:text="@string/copyIssueUrl" android:text="@string/copyIssueUrl"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" /> android:textSize="16sp"
android:padding="12dp" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="12dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="12dp"
android:layout_marginStart="64dp" android:layout_marginStart="64dp"
android:background="?attr/dividerColor" /> android:background="?attr/dividerColor" />
@ -154,7 +153,7 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" /> android:padding="12dp" />
<TextView <TextView
android:id="@+id/reOpenIssue" android:id="@+id/reOpenIssue"
@ -166,8 +165,8 @@
android:drawablePadding="24dp" android:drawablePadding="24dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="16sp" android:textSize="16sp"
android:padding="16dp" android:visibility="gone"
android:visibility="gone" /> android:padding="12dp" />
</LinearLayout> </LinearLayout>

View File

@ -61,6 +61,7 @@
android:textSize="14sp" /> android:textSize="14sp" />
<View <View
android:id="@+id/divider"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
@ -73,6 +74,7 @@
android:gravity="center_vertical"> android:gravity="center_vertical">
<ImageView <ImageView
android:id="@+id/userLanguageIcon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="18dp" android:layout_height="18dp"
android:layout_marginRight="2dp" android:layout_marginRight="2dp"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
@ -24,7 +23,7 @@
android:id="@+id/commendBodyRaw" android:id="@+id/commendBodyRaw"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"/> android:visibility="gone" />
<TextView <TextView
android:id="@+id/commenterUsername" android:id="@+id/commenterUsername"

View File

@ -1,61 +1,86 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/linearLayoutMainFrame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:background="?attr/primaryBackgroundColor"
android:id="@+id/relativeLayoutMainFrame" android:orientation="horizontal"
android:background="?attr/primaryBackgroundColor"> android:padding="10dp">
<TextView <TextView
android:id="@+id/labelTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:layout_weight="1"
android:id="@+id/labelTitle"/> android:visibility="gone" />
<TextView <TextView
android:id="@+id/labelId"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:layout_weight="1"
android:id="@+id/labelId"/> android:visibility="gone" />
<TextView <TextView
android:id="@+id/labelColor"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:layout_weight="1"
android:id="@+id/labelColor"/> android:visibility="gone" />
<LinearLayout <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:id="@+id/labelView"
android:layout_height="match_parent" android:layout_width="wrap_content"
android:layout_margin="15dp" android:layout_height="wrap_content"
android:id="@+id/labelsFrame" app:cardCornerRadius="5dp"
android:orientation="horizontal"> app:cardElevation="0dp"
app:contentPaddingBottom="3dp"
app:contentPaddingLeft="10dp"
app:contentPaddingRight="10dp"
app:contentPaddingTop="3dp">
<ImageView <LinearLayout
android:id="@+id/labelsView" android:layout_width="match_parent"
android:layout_width="0dp" android:layout_height="match_parent"
android:layout_height="wrap_content" android:gravity="center_vertical"
android:layout_gravity="start" android:orientation="horizontal">
android:paddingTop="5dp"
android:contentDescription="@string/labelMenuContentDesc"
android:gravity="start"
android:layout_weight="1"
android:scaleType="fitStart"
android:src="@drawable/ic_label" />
<ImageView <ImageView
android:id="@+id/labelsOptionsMenu" android:id="@+id/labelIcon"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_weight="0"
android:layout_weight="0.15" android:contentDescription="@string/generalImgContentText"
android:contentDescription="@string/labelMenuContentDesc" android:tint="@color/colorWhite"
android:gravity="end" app:srcCompat="@drawable/ic_label" />
android:scaleType="fitEnd"
android:src="@drawable/ic_dotted_menu_horizontal" />
</LinearLayout> <TextView
android:id="@+id/labelName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:textColor="@color/colorWhite"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout> </androidx.cardview.widget.CardView>
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/labelsOptionsMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:contentDescription="@string/labelMenuContentDesc"
android:paddingLeft="10dp"
android:src="@drawable/ic_dotted_menu_horizontal" />
</LinearLayout>

View File

@ -27,8 +27,7 @@
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold" />
tools:text="3.0.0-rc1" />
<TextView <TextView
android:id="@+id/releaseType" android:id="@+id/releaseType"
@ -68,8 +67,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="Published by @mmarif" />
</LinearLayout> </LinearLayout>
@ -99,8 +97,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="3.0.0-rc1" />
</LinearLayout> </LinearLayout>
@ -125,8 +122,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="8b1c79c0c3" />
</LinearLayout> </LinearLayout>
@ -150,8 +146,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:singleLine="true" android:singleLine="true"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="1 day ago" />
</LinearLayout> </LinearLayout>
@ -172,9 +167,10 @@
android:id="@+id/releaseBodyContent" android:id="@+id/releaseBodyContent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autoLink="web|email"
android:textColorLink="@color/lightBlue"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="Put your release body here" />
</LinearLayout> </LinearLayout>
@ -207,8 +203,7 @@
android:layout_marginStart="3dp" android:layout_marginStart="3dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp"
android:text="@string/releaseDownloadText" android:text="@string/releaseDownloadText" />
tools:text="Downloads" />
</LinearLayout> </LinearLayout>
@ -229,8 +224,7 @@
android:drawableStart="@drawable/ic_file_download_24dp" android:drawableStart="@drawable/ic_file_download_24dp"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="Source code (ZIP)" />
<TextView <TextView
android:id="@+id/releaseTarDownload" android:id="@+id/releaseTarDownload"
@ -241,8 +235,7 @@
android:drawableStart="@drawable/ic_file_download_24dp" android:drawableStart="@drawable/ic_file_download_24dp"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:textColor="?attr/primaryTextColor" android:textColor="?attr/primaryTextColor"
android:textSize="14sp" android:textSize="14sp" />
tools:text="Source code (TAR)" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/downloadList" android:id="@+id/downloadList"

View File

@ -29,19 +29,17 @@
android:id="@+id/userAvatar" android:id="@+id/userAvatar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_android"
android:maxHeight="24dp" android:maxHeight="24dp"
android:maxWidth="24dp" android:maxWidth="24dp"
android:paddingStart="20dp" android:paddingStart="20dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:contentDescription="@string/app_name"/> android:contentDescription="@string/generalImgContentText"/>
<TextView <TextView
android:id="@+id/userFullname" android:id="@+id/userFullname"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="10dp" android:paddingTop="10dp"
android:text="@string/app_name"
android:textSize="18sp" android:textSize="18sp"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textColor="@color/white" android:textColor="@color/white"
@ -59,7 +57,6 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="0.85" android:layout_weight="0.85"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/appEmail"
android:textSize="14sp" android:textSize="14sp"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textColor="@color/white" android:textColor="@color/white"

View File

@ -24,6 +24,7 @@
<item name="hintColor">@color/hintColor</item> <item name="hintColor">@color/hintColor</item>
<item name="colorControlActivated">@color/darkGreen</item> <item name="colorControlActivated">@color/darkGreen</item>
<item name="dividerColor">@color/lightThemeDividerColor</item> <item name="dividerColor">@color/lightThemeDividerColor</item>
<item name="bottomSheetDialogTheme">@style/AppThemeLightBottomSheetDialog</item>
</style> </style>
</resources> </resources>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="protocolValues">
<item>HTTPS</item>
<item>HTTP</item>
</string-array>
</resources>

View File

@ -9,6 +9,7 @@
<item>Sameer Gupta</item> <item>Sameer Gupta</item>
<item>Yin Yihang</item> <item>Yin Yihang</item>
<item>Svierne</item> <item>Svierne</item>
<item>Sam Forest</item>
</string-array> </string-array>
</resources> </resources>

View File

@ -217,6 +217,7 @@
<string name="noDataReleasesTab">No releases found</string> <string name="noDataReleasesTab">No releases found</string>
<string name="releaseTag">Tag: %1$s</string> <string name="releaseTag">Tag: %1$s</string>
<string name="releasePublishedBy">Published by @%1$s</string> <string name="releasePublishedBy">Published by @%1$s</string>
<string name="noReleaseBodyContent">Release notes are not provided by the publisher.</string>
<string name="collaboratorsNameToast">Collaborator : %1$s</string> <string name="collaboratorsNameToast">Collaborator : %1$s</string>
<string name="noDataCollaboratorTab">No collaborators found</string> <string name="noDataCollaboratorTab">No collaborators found</string>
@ -516,6 +517,7 @@
<string name="copyIssueUrl">Copy Issue URL</string> <string name="copyIssueUrl">Copy Issue URL</string>
<string name="copyIssueUrlToastMsg">URL copied to clipboard</string> <string name="copyIssueUrlToastMsg">URL copied to clipboard</string>
<string name="copyIssueCommentToastMsg">Copied comment to clipboard</string>
<string name="milestoneCompletion">%1$d\uFF05 completed</string> <string name="milestoneCompletion">%1$d\uFF05 completed</string>
@ -525,6 +527,8 @@
<string name="filesGenericError">Sorry this file cannot be viewed as API returned an error</string> <string name="filesGenericError">Sorry this file cannot be viewed as API returned an error</string>
<string name="filesBreadcrumb">Root</string> <string name="filesBreadcrumb">Root</string>
<string name="notSupported">Not supported</string>
<!-- generic copy --> <!-- generic copy -->
<string name="okButton">OK</string> <string name="okButton">OK</string>
<string name="doneButton">Done</string> <string name="doneButton">Done</string>
@ -538,6 +542,8 @@
<string name="menuContentDesc">Menu</string> <string name="menuContentDesc">Menu</string>
<string name="menuEditText">Edit</string> <string name="menuEditText">Edit</string>
<string name="menuDeleteText">Delete</string> <string name="menuDeleteText">Delete</string>
<string name="menuCopyText">Copy</string>
<string name="menuQuoteText">Quote and Reply</string>
<string name="colorfulBulletSpan" translatable="false">\u0020\u0020\u0020\u25CF\u0020\u0020\u0020</string> <string name="colorfulBulletSpan" translatable="false">\u0020\u0020\u0020\u25CF\u0020\u0020\u0020</string>
<string name="modifiedText">edited</string> <string name="modifiedText">edited</string>
<string name="saveButton">Save</string> <string name="saveButton">Save</string>
@ -587,6 +593,7 @@
<string name="unauthorizedApiError">Instance has returned an error - Unauthorized. Check your credentials and try again</string> <string name="unauthorizedApiError">Instance has returned an error - Unauthorized. Check your credentials and try again</string>
<string name="loginTokenError">Please enter the correct token</string> <string name="loginTokenError">Please enter the correct token</string>
<string name="prDeletedFrok">Deleted Fork</string>
<string name="noDataPullRequests">No pull requests found</string> <string name="noDataPullRequests">No pull requests found</string>
<string name="prCreator">Creator :\u0020</string> <string name="prCreator">Creator :\u0020</string>
<string name="editPrText">Edit Pull Request</string> <string name="editPrText">Edit Pull Request</string>

View File

@ -24,6 +24,7 @@
<item name="hintColor">@color/hintColor</item> <item name="hintColor">@color/hintColor</item>
<item name="colorControlActivated">@color/darkGreen</item> <item name="colorControlActivated">@color/darkGreen</item>
<item name="dividerColor">@color/dividerColorDark</item> <item name="dividerColor">@color/dividerColorDark</item>
<item name="bottomSheetDialogTheme">@style/AppThemeDarkBottomSheetDialog</item>
</style> </style>
<!-- Dark theme - default --> <!-- Dark theme - default -->
@ -50,9 +51,22 @@
<item name="hintColor">@color/hintColor</item> <item name="hintColor">@color/hintColor</item>
<item name="colorControlActivated">@color/darkGreen</item> <item name="colorControlActivated">@color/darkGreen</item>
<item name="dividerColor">@color/lightThemeDividerColor</item> <item name="dividerColor">@color/lightThemeDividerColor</item>
<item name="bottomSheetDialogTheme">@style/AppThemeLightBottomSheetDialog</item>
</style> </style>
<!-- Light theme --> <!-- Light theme -->
<style name="AppThemeDarkBottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppBottomSheetModalStyle</item>
</style>
<style name="AppThemeLightBottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/AppBottomSheetModalStyle</item>
</style>
<style name="AppBottomSheetModalStyle" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/bottom_sheet_top_corners</item>
</style>
<style name="AppThemeLightSearchAutoCompleteTextView" parent="Widget.AppCompat.Light.AutoCompleteTextView"> <style name="AppThemeLightSearchAutoCompleteTextView" parent="Widget.AppCompat.Light.AutoCompleteTextView">
<item name="android:textColor">@color/lightThemeTextColor</item> <item name="android:textColor">@color/lightThemeTextColor</item>
<item name="android:textColorHint">@color/lightThemeTextColor</item> <item name="android:textColorHint">@color/lightThemeTextColor</item>
@ -104,4 +118,4 @@
<item name="buttonTint">@color/colorWhite</item> <item name="buttonTint">@color/colorWhite</item>
</style> </style>
</resources> </resources>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<changelog> <changelog>
<release version="3.0.0-rc2" versioncode="296"> <release version="3.0.0-rc3" versioncode="297">
<change>Under development</change> <change>Under development</change>
</release> </release>

View File

@ -0,0 +1,5 @@
3.0.0-rc3
This release focuses to enhance the UI through out the app with few new features and fix the bugs you guys reported so far.
Detailed release notes will be published with the stable release.