Replacing bottom sheet item by floating action button. (#360)
Merge branch 'fab-button-issues' of https://gitea.com/opyale/GitNex into fab-button-issues Merge remote-tracking branch 'remotes/main/master' into fab-button-issues Merge branch 'master' into fab-button-issues Adding onScrollListener. Reply icon Generalizing padding of floating action button. Merge branch 'master' into fab-button-issues Improving proportions. Replacing bottom sheet item by floating action button and cleaning up code. Co-authored-by: opyale <example@example.com> Co-authored-by: anonTree1417 <example@example.com> Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/360 Reviewed-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
@@ -29,6 +29,7 @@ import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -95,6 +96,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
private HorizontalScrollView assigneesScrollView;
|
||||
private ScrollView scrollViewComments;
|
||||
private TextView issueModified;
|
||||
private ImageView createNewComment;
|
||||
final Context ctx = this;
|
||||
private LinearLayout labelsLayout;
|
||||
private LinearLayout assigneesLayout;
|
||||
@@ -132,6 +134,7 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
assigneesScrollView = findViewById(R.id.assigneesScrollView);
|
||||
scrollViewComments = findViewById(R.id.scrollViewComments);
|
||||
issueModified = findViewById(R.id.issueModified);
|
||||
createNewComment = findViewById(R.id.addNewComment);
|
||||
labelsLayout = findViewById(R.id.frameLabels);
|
||||
assigneesLayout = findViewById(R.id.frameAssignees);
|
||||
|
||||
@@ -147,10 +150,38 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
mRecyclerView.setNestedScrollingEnabled(false);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(),
|
||||
DividerItemDecoration.VERTICAL);
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
createNewComment = findViewById(R.id.addNewComment);
|
||||
createNewComment.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
startActivity(new Intent(ctx, ReplyToIssueActivity.class));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
|
||||
if (dy > 0 && createNewComment.isShown()) {
|
||||
createNewComment.setVisibility(View.GONE);
|
||||
} else if (dy < 0) {
|
||||
createNewComment.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
|
||||
super.onScrollStateChanged(recyclerView, newState);
|
||||
}
|
||||
});
|
||||
|
||||
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
@@ -165,24 +196,24 @@ public class IssueDetailActivity extends BaseActivity {
|
||||
});
|
||||
|
||||
Typeface myTypeface;
|
||||
if(tinyDb.getInt("customFontId") == 0) {
|
||||
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
||||
switch(tinyDb.getInt("customFontId")) {
|
||||
|
||||
}
|
||||
else if (tinyDb.getInt("customFontId") == 1) {
|
||||
case 0:
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
||||
break;
|
||||
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/manroperegular.ttf");
|
||||
case 1:
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/manroperegular.ttf");
|
||||
break;
|
||||
|
||||
}
|
||||
else if (tinyDb.getInt("customFontId") == 2) {
|
||||
case 2:
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||
break;
|
||||
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
||||
default:
|
||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
final Context ctx = getContext();
|
||||
final TinyDB tinyDB = new TinyDB(ctx);
|
||||
|
||||
TextView replyToIssue = v.findViewById(R.id.replyToIssue);
|
||||
TextView editIssue = v.findViewById(R.id.editIssue);
|
||||
TextView editLabels = v.findViewById(R.id.editLabels);
|
||||
TextView closeIssue = v.findViewById(R.id.closeIssue);
|
||||
@@ -56,16 +55,6 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
TextView subscribeIssue = v.findViewById(R.id.subscribeIssue);
|
||||
TextView unsubscribeIssue = v.findViewById(R.id.unsubscribeIssue);
|
||||
|
||||
replyToIssue.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
startActivity(new Intent(ctx, ReplyToIssueActivity.class));
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if(tinyDB.getString("issueType").equals("pr")) {
|
||||
|
||||
editIssue.setText(R.string.editPrText);
|
||||
|
||||
@@ -100,18 +100,18 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(),
|
||||
DividerItemDecoration.VERTICAL);
|
||||
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
createNewRepo = v.findViewById(R.id.addNewRepo);
|
||||
|
||||
createNewRepo.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -119,12 +119,13 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
|
||||
if (dy > 0 && createNewRepo.isShown()) {
|
||||
createNewRepo.setVisibility(View.GONE);
|
||||
} else if (dy < 0 ) {
|
||||
} else if (dy < 0) {
|
||||
createNewRepo.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user