|
|
|
@ -66,14 +66,13 @@ import android.view.animation.TranslateAnimation;
|
|
|
|
|
import android.webkit.WebSettings;
|
|
|
|
|
import android.webkit.WebView;
|
|
|
|
|
import android.webkit.WebViewClient;
|
|
|
|
|
import android.widget.AdapterView;
|
|
|
|
|
import android.widget.ArrayAdapter;
|
|
|
|
|
import android.widget.Button;
|
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
|
import android.widget.CompoundButton;
|
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
|
import android.widget.ListView;
|
|
|
|
|
import android.widget.SeekBar;
|
|
|
|
|
import android.widget.Spinner;
|
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
@ -4642,27 +4641,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
@Override
|
|
|
|
|
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_identity, null);
|
|
|
|
|
ListView lvIdentity = dview.findViewById(R.id.lvIdentity);
|
|
|
|
|
CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
|
|
|
|
|
Button btnFix = dview.findViewById(R.id.btnFix);
|
|
|
|
|
Group grpIdentities = dview.findViewById(R.id.grpIdentities);
|
|
|
|
|
Group grpNoIdentities = dview.findViewById(R.id.grpNoIdentities);
|
|
|
|
|
ContentLoadingProgressBar pbWait = dview.findViewById(R.id.pbWait);
|
|
|
|
|
|
|
|
|
|
lvIdentity.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
|
|
TupleIdentityEx identity = (TupleIdentityEx) lvIdentity.getAdapter().getItem(position);
|
|
|
|
|
|
|
|
|
|
startActivity(new Intent(getContext(), ActivityCompose.class)
|
|
|
|
|
.putExtra("action", "new")
|
|
|
|
|
.putExtra("account", identity.account)
|
|
|
|
|
.putExtra("identity", identity.id)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
dismiss();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
final Spinner spIdentity = dview.findViewById(R.id.spIdentity);
|
|
|
|
|
final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
|
|
|
|
|
final Button btnFix = dview.findViewById(R.id.btnFix);
|
|
|
|
|
final Group grpIdentities = dview.findViewById(R.id.grpIdentities);
|
|
|
|
|
final Group grpNoIdentities = dview.findViewById(R.id.grpNoIdentities);
|
|
|
|
|
final ContentLoadingProgressBar pbWait = dview.findViewById(R.id.pbWait);
|
|
|
|
|
|
|
|
|
|
cbNotAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
@ -4677,7 +4661,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
startActivity(new Intent(getContext(), ActivitySetup.class));
|
|
|
|
|
getActivity().finish();
|
|
|
|
|
|
|
|
|
|
dismiss();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -4705,7 +4688,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
@Override
|
|
|
|
|
protected void onExecuted(Bundle args, List<TupleIdentityEx> identities) {
|
|
|
|
|
AdapterIdentitySelect iadapter = new AdapterIdentitySelect(getContext(), identities);
|
|
|
|
|
lvIdentity.setAdapter(iadapter);
|
|
|
|
|
spIdentity.setAdapter(iadapter);
|
|
|
|
|
|
|
|
|
|
grpIdentities.setVisibility(identities.size() > 0 ? View.VISIBLE : View.GONE);
|
|
|
|
|
grpNoIdentities.setVisibility(identities.size() > 0 ? View.GONE : View.VISIBLE);
|
|
|
|
@ -4719,6 +4702,18 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|
|
|
|
|
|
|
|
|
return new AlertDialog.Builder(getContext())
|
|
|
|
|
.setView(dview)
|
|
|
|
|
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
|
TupleIdentityEx identity = (TupleIdentityEx) spIdentity.getSelectedItem();
|
|
|
|
|
if (identity != null)
|
|
|
|
|
startActivity(new Intent(getContext(), ActivityCompose.class)
|
|
|
|
|
.putExtra("action", "new")
|
|
|
|
|
.putExtra("account", identity.account)
|
|
|
|
|
.putExtra("identity", identity.id)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.setNegativeButton(android.R.string.cancel, null)
|
|
|
|
|
.create();
|
|
|
|
|
}
|
|
|
|
|