remove unused InviteActivity, it was disabled 9 months ago in #790

This commit is contained in:
B. Petersen
2020-01-17 14:08:22 +01:00
parent 3fe96722e6
commit 0f64d4e9c5
14 changed files with 0 additions and 209 deletions
-10
View File
@@ -52,16 +52,6 @@
android:resource="@xml/automotive_app_desc" />
-->
<activity android:name=".InviteActivity"
android:theme="@style/TextSecure.HighlightTheme"
android:windowSoftInputMode="stateHidden"
android:parentActivityName=".ConversationListActivity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.thoughtcrime.securesms.ConversationListActivity" />
</activity>
<activity android:name=".ShareActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:excludeFromRecents="true"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_mood_white_24dp"
android:tint="?attr/pref_icon_tint"/>
-71
View File
@@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:clickable="false">
<LinearLayout android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:padding="10dp"
android:background="?attr/invite_background">
<ImageView android:id="@+id/heart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:contentDescription="@null"
android:src="@drawable/love_heart" />
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="20sp"
android:text="@string/invite_slogan"
android:gravity="center_horizontal"
android:layout_marginBottom="30dp"
android:layout_marginTop="18dp"
android:fontFamily="sans-serif-light"
android:paddingLeft="10dp"
android:paddingStart="10dp"/>
<EditText android:id="@+id/invite_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="2"
tools:text="Let's switch to Signal: https://sgnl.link/asdfdfsa"
android:background="@drawable/message_bubble_background_sent_alone"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:gravity="top"
android:inputType="textShortMessage|textMultiLine"
android:textColor="#ff333333"/>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<Button android:id="@+id/share_button"
android:drawablePadding="10dp"
android:drawableLeft="@drawable/ic_share_black_18dp"
android:drawableStart="@drawable/ic_share_black_18dp"
android:text="@string/menu_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="ButtonStyle" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
-2
View File
@@ -98,8 +98,6 @@
<attr name="import_export_item_background_shadow_color" format="reference|color" />
<attr name="import_export_item_card_background" format="reference" />
<attr name="invite_background" format="color"/>
<attr name="reminder_header_background" format="color"/>
<attr name="menu_new_conversation_icon" format="reference" />
-6
View File
@@ -163,7 +163,6 @@
<string name="menu_pause">Pause</string>
<string name="menu_scroll_to_bottom">Scroll to the bottom</string>
<string name="menu_scroll_to_top">Scroll to the top</string>
<string name="menu_invite">Invite friends</string>
<string name="menu_help">Help</string>
<string name="menu_select_all">Select all</string>
<string name="menu_expand">Expand</string>
@@ -301,11 +300,6 @@
<string name="tab_gallery_empty_hint">Images and videos shared in this chat will be displayed here.</string>
<string name="tab_docs_empty_hint">Documents, music and other files shared in this chat will be displayed here.</string>
<string name="media_preview">Media preview</string>
<!-- invite -->
<string name="invite_slogan">Friends don\'t let friends locked in messaging silos.</string>
<string name="invite_default_text">Let\'s switch to Delta Chat - %1$s - you can text me at %2$s</string>
<!-- welcome and login -->
-2
View File
@@ -207,7 +207,6 @@
<item name="search_toolbar_background">@color/white</item>
<item name="search_background">@color/white</item>
<item name="invite_background">@color/delta_primary</item>
<item name="shared_contact_details_header_background">@color/grey_100</item>
<item name="shared_contact_details_titlebar">@color/grey_400</item>
@@ -350,7 +349,6 @@
<item name="preferenceTheme">@style/PreferenceThemeOverlay.Fix</item>
<item name="search_toolbar_background">@color/black</item>
<item name="search_background">@color/black</item>
<item name="invite_background">@color/black</item>
<item name="shared_contact_details_header_background">@color/grey_800</item>
<item name="shared_contact_details_titlebar">@color/grey_900</item>
-5
View File
@@ -30,11 +30,6 @@
android:icon="@drawable/ic_advanced_24dp"
android:layout="@layout/preference_item" />
<Preference android:key="preference_category_invite"
android:title="@string/menu_invite"
android:icon="@drawable/ic_invite_24dp"
android:layout="@layout/preference_item" />
<Preference android:key="preference_category_help"
android:title="@string/menu_help"
android:icon="@drawable/ic_help_24dp"
@@ -67,7 +67,6 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
private static final String PREFERENCE_CATEGORY_APPEARANCE = "preference_category_appearance";
private static final String PREFERENCE_CATEGORY_CHATS = "preference_category_chats";
private static final String PREFERENCE_CATEGORY_ADVANCED = "preference_category_advanced";
private static final String PREFERENCE_CATEGORY_INVITE = "preference_category_invite";
private static final String PREFERENCE_CATEGORY_HELP = "preference_category_help";
public static final int REQUEST_CODE_SET_BACKGROUND = 11;
@@ -148,10 +147,6 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
this.findPreference(PREFERENCE_CATEGORY_ADVANCED)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_ADVANCED));
Preference invitePreference = this.findPreference(PREFERENCE_CATEGORY_INVITE);
invitePreference.setVisible(false);
invitePreference.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_INVITE));
this.findPreference(PREFERENCE_CATEGORY_HELP)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_HELP));
@@ -195,7 +190,6 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
Drawable appearance = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_brightness_6_white_24dp));
Drawable chats = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_forum_white_24dp));
Drawable advanced = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_advanced_white_24dp));
Drawable invite = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_mood_white_24dp));
Drawable help = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_help_white_24dp));
int[] tintAttr = new int[]{R.attr.pref_icon_tint};
@@ -208,7 +202,6 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
DrawableCompat.setTint(appearance, color);
DrawableCompat.setTint(chats, color);
DrawableCompat.setTint(advanced, color);
DrawableCompat.setTint(invite, color);
DrawableCompat.setTint(help, color);
this.findPreference(PREFERENCE_CATEGORY_NOTIFICATIONS).setIcon(notifications);
@@ -216,7 +209,6 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
this.findPreference(PREFERENCE_CATEGORY_APPEARANCE).setIcon(appearance);
this.findPreference(PREFERENCE_CATEGORY_CHATS).setIcon(chats);
this.findPreference(PREFERENCE_CATEGORY_ADVANCED).setIcon(advanced);
this.findPreference(PREFERENCE_CATEGORY_INVITE).setIcon(invite);
this.findPreference(PREFERENCE_CATEGORY_HELP).setIcon(help);
}
@@ -247,9 +239,6 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
case PREFERENCE_CATEGORY_ADVANCED:
fragment = new AdvancedPreferenceFragment();
break;
case PREFERENCE_CATEGORY_INVITE:
startActivity(new Intent(getActivity(), InviteActivity.class));
break;
case PREFERENCE_CATEGORY_HELP:
startActivity(new Intent(getActivity(), LocalHelpActivity.class));
break;
@@ -1,98 +0,0 @@
package org.thoughtcrime.securesms;
import android.animation.Animator;
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import androidx.annotation.AnimRes;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewAnimationUtils;
import android.view.ViewTreeObserver.OnPreDrawListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.util.ViewUtil;
public class InviteActivity extends PassphraseRequiredActionBarActivity {
private EditText inviteText;
private Animation slideInAnimation;
private Animation slideOutAnimation;
private ImageView heart;
@Override
protected void onCreate(Bundle savedInstanceState, boolean ready) {
getIntent().putExtra(ContactSelectionListFragment.MULTI_SELECT, true);
getIntent().putExtra(ContactSelectionListFragment.REFRESHABLE, false);
setContentView(R.layout.invite_activity);
assert getSupportActionBar() != null;
getSupportActionBar().setTitle(R.string.menu_invite);
initializeResources();
}
private void initializeResources() {
slideInAnimation = loadAnimation(R.anim.slide_from_bottom);
slideOutAnimation = loadAnimation(R.anim.slide_to_bottom);
View shareButton = ViewUtil.findById(this, R.id.share_button);
inviteText = ViewUtil.findById(this, R.id.invite_text);
heart = ViewUtil.findById(this, R.id.heart);
String selfMail = DcHelper.getContext(this).getConfig("addr", "");
inviteText.setText(getString(R.string.invite_default_text, "https://delta.chat", selfMail));
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
heart.getViewTreeObserver().addOnPreDrawListener(new HeartPreDrawListener());
}
shareButton.setOnClickListener(new ShareClickListener());
}
private Animation loadAnimation(@AnimRes int animResId) {
final Animation animation = AnimationUtils.loadAnimation(this, animResId);
animation.setInterpolator(new FastOutSlowInInterpolator());
return animation;
}
private class ShareClickListener implements OnClickListener {
@Override
public void onClick(View v) {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, inviteText.getText().toString());
sendIntent.setType("text/plain");
if (sendIntent.resolveActivity(getPackageManager()) != null) {
startActivity(Intent.createChooser(sendIntent, getString(R.string.menu_invite)));
} else {
Toast.makeText(InviteActivity.this, R.string.no_app_to_handle_data, Toast.LENGTH_LONG).show();
}
}
}
private class HeartPreDrawListener implements OnPreDrawListener {
@Override
@TargetApi(VERSION_CODES.LOLLIPOP)
public boolean onPreDraw() {
heart.getViewTreeObserver().removeOnPreDrawListener(this);
final int w = heart.getWidth();
final int h = heart.getHeight();
Animator reveal = ViewAnimationUtils.createCircularReveal(heart,
w / 2, h,
0, (float)Math.sqrt(h*h + (w*w/4)));
reveal.setInterpolator(new FastOutSlowInInterpolator());
reveal.setDuration(800);
reveal.start();
return false;
}
}
}