Add/Remove new member to team (#483)

Search as user type, fix datalist.

Code Format

Fix users search theme

add and remove user from team

Add interface and user search and check for being team member or not

bottom sheet menu and few refactors

Co-authored-by: 6543 <6543@noreply.gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/483
Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
M M Arif
2020-05-20 18:21:09 +00:00
committed by 6543
parent 0f38d81cd0
commit 7bfdfa3223
24 changed files with 846 additions and 79 deletions

View File

@@ -22,7 +22,7 @@ public class BottomSheetAdminUsersFragment extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_admin_users_layout, container, false);
View v = inflater.inflate(R.layout.bottom_sheet_admin_users, container, false);
TextView createNewUser = v.findViewById(R.id.createNewUser);

View File

@@ -22,7 +22,7 @@ public class BottomSheetOrganizationFragment extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_organization_layout, container, false);
View v = inflater.inflate(R.layout.bottom_sheet_organization, container, false);
TextView createTeam = v.findViewById(R.id.createTeam);
TextView createRepository = v.findViewById(R.id.createRepository);

View File

@@ -0,0 +1,58 @@
package org.mian.gitnex.fragments;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import org.mian.gitnex.R;
/**
* Author M M Arif
*/
public class BottomSheetOrganizationTeamsFragment extends BottomSheetDialogFragment {
private BottomSheetOrganizationTeamsFragment.BottomSheetListener bmListener;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_organization_teams, container, false);
TextView addNewMember = v.findViewById(R.id.addNewMember);
addNewMember.setOnClickListener(v1 -> {
bmListener.onButtonClicked("newMember");
dismiss();
});
return v;
}
public interface BottomSheetListener {
void onButtonClicked(String text);
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
try {
bmListener = (BottomSheetOrganizationTeamsFragment.BottomSheetListener) context;
}
catch (ClassCastException e) {
Log.e("BsOrganizationTeams", e.toString());
}
}
}

View File

@@ -21,7 +21,7 @@ public class BottomSheetProfileFragment extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_profile_layout, container, false);
View v = inflater.inflate(R.layout.bottom_sheet_profile, container, false);
TextView addNewEmailAddress = v.findViewById(R.id.addNewEmailAddress);

View File

@@ -24,7 +24,7 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_repo_layout, container, false);
View v = inflater.inflate(R.layout.bottom_sheet_repo, container, false);
final TinyDB tinyDb = new TinyDB(getContext());

View File

@@ -33,7 +33,7 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.bottom_sheet_single_issue_layout, container, false);
View v = inflater.inflate(R.layout.bottom_sheet_single_issue, container, false);
final Context ctx = getContext();
final TinyDB tinyDB = new TinyDB(ctx);