Added contact groups help

pull/194/merge
M66B 3 years ago
parent dfc68e60f6
commit 80c5e3ddf3

@ -6610,16 +6610,28 @@ public class FragmentCompose extends FragmentBase {
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
final long working = getArguments().getLong("working"); final Bundle args = getArguments();
int focussed = getArguments().getInt("focussed"); final long working = args.getLong("working");
int focussed = args.getInt("focussed");
final Context context = getContext(); final Context context = getContext();
final PackageManager pm = context.getPackageManager();
final ContentResolver resolver = context.getContentResolver();
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_contact_group, null); View dview = LayoutInflater.from(context).inflate(R.layout.dialog_contact_group, null);
final ImageButton ibInfo = dview.findViewById(R.id.ibInfo);
final Spinner spGroup = dview.findViewById(R.id.spGroup); final Spinner spGroup = dview.findViewById(R.id.spGroup);
final Spinner spTarget = dview.findViewById(R.id.spTarget); final Spinner spTarget = dview.findViewById(R.id.spTarget);
final Button btnManage = dview.findViewById(R.id.btnManage);
String[] projection = new String[]{ ibInfo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(v.getContext(), Uri.parse(Helper.URI_SUPPORT_CONTACT_GROUP), true);
}
});
final String[] projection = new String[]{
ContactsContract.Groups._ID, ContactsContract.Groups._ID,
ContactsContract.Groups.TITLE, ContactsContract.Groups.TITLE,
ContactsContract.Groups.SUMMARY_COUNT, ContactsContract.Groups.SUMMARY_COUNT,
@ -6629,7 +6641,7 @@ public class FragmentCompose extends FragmentBase {
Cursor groups; Cursor groups;
try { try {
groups = context.getContentResolver().query( groups = resolver.query(
ContactsContract.Groups.CONTENT_SUMMARY_URI, ContactsContract.Groups.CONTENT_SUMMARY_URI,
projection, projection,
// ContactsContract.Groups.GROUP_VISIBLE + " = 1" + " AND " + // ContactsContract.Groups.GROUP_VISIBLE + " = 1" + " AND " +

@ -71,8 +71,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class FragmentDialogOpenLink extends FragmentDialogBase { public class FragmentDialogOpenLink extends FragmentDialogBase {
private static final String URI_RESET_OPEN = "https://support.google.com/pixelphone/answer/6271667";
private ImageButton ibMore; private ImageButton ibMore;
private TextView tvMore; private TextView tvMore;
private Button btnOwner; private Button btnOwner;
@ -383,8 +381,8 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
tvReset.setPaintFlags(tvReset.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); tvReset.setPaintFlags(tvReset.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
tvReset.setOnClickListener(new View.OnClickListener() { tvReset.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View c) {
Helper.view(view.getContext(), Uri.parse(URI_RESET_OPEN), true); Helper.view(c.getContext(), Uri.parse(Helper.URI_SUPPORT_RESET_OPEN), true);
} }
}); });

@ -171,6 +171,8 @@ public class Helper {
static final String GRAVATAR_PRIVACY_URI = "https://en.wikipedia.org/wiki/Gravatar"; static final String GRAVATAR_PRIVACY_URI = "https://en.wikipedia.org/wiki/Gravatar";
static final String LICENSE_URI = "https://www.gnu.org/licenses/gpl-3.0.html"; static final String LICENSE_URI = "https://www.gnu.org/licenses/gpl-3.0.html";
static final String DONTKILL_URI = "https://dontkillmyapp.com/"; static final String DONTKILL_URI = "https://dontkillmyapp.com/";
static final String URI_SUPPORT_RESET_OPEN = "https://support.google.com/pixelphone/answer/6271667";
static final String URI_SUPPORT_CONTACT_GROUP = "https://support.google.com/contacts/answer/30970";
// https://developer.android.com/distribute/marketing-tools/linking-to-google-play#PerformingSearch // https://developer.android.com/distribute/marketing-tools/linking-to-google-play#PerformingSearch
private static final String PLAY_STORE_SEARCH = "https://play.google.com/store/search"; private static final String PLAY_STORE_SEARCH = "https://play.google.com/store/search";

@ -1,37 +1,58 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <eu.faircode.email.ScrollViewEx xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="24dp"> android:padding="24dp"
android:scrollbarStyle="outsideOverlay">
<eu.faircode.email.FixedTextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/tvGroup" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:drawableStart="@drawable/twotone_people_24"
android:drawablePadding="6dp"
android:text="@string/title_insert_contact_group"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner <eu.faircode.email.FixedTextView
android:id="@+id/spTarget" android:id="@+id/tvGroup"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:drawableStart="@drawable/twotone_people_24"
android:entries="@array/targetNames" android:drawablePadding="6dp"
app:layout_constraintEnd_toEndOf="parent" android:text="@string/title_insert_contact_group"
app:layout_constraintStart_toStartOf="parent" android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintTop_toBottomOf="@id/tvGroup" /> app:layout_constraintEnd_toStartOf="@+id/ibInfo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner <ImageButton
android:id="@+id/spGroup" android:id="@+id/ibInfo"
android:layout_width="0dp" android:layout_width="36dp"
android:layout_height="wrap_content" android:layout_height="36dp"
android:layout_marginTop="24dp" android:background="?android:attr/selectableItemBackgroundBorderless"
app:layout_constraintEnd_toEndOf="parent" android:contentDescription="@string/title_info"
app:layout_constraintStart_toStartOf="parent" android:padding="6dp"
app:layout_constraintTop_toBottomOf="@id/spTarget" /> android:scaleType="fitCenter"
</androidx.constraintlayout.widget.ConstraintLayout> android:tooltipText="@string/title_info"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/twotone_info_24"
app:tint="?attr/colorAccent" />
<Spinner
android:id="@+id/spTarget"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:entries="@array/targetNames"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvGroup" />
<Spinner
android:id="@+id/spGroup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spTarget" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

Loading…
Cancel
Save