remove pager with weird descriptions, tweak welcome layout

This commit is contained in:
B. Petersen
2019-12-05 00:07:23 +01:00
parent a5b0a322a5
commit 3549c5591d
13 changed files with 39 additions and 203 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/paging_indicator_selected"
android:state_selected="true"/>
<item android:drawable="@drawable/paging_indicator_default"/>
</selector>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:innerRadius="0dp"
android:shape="ring"
android:thickness="8dp"
android:useLevel="false">
<solid android:color="@color/grey_400"/>
</shape>
</item>
</layer-list>
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:innerRadius="0dp"
android:shape="ring"
android:thickness="8dp"
android:useLevel="false">
<solid android:color="@color/delta_accent"/>
</shape>
</item>
</layer-list>
+37 -44
View File
@@ -1,74 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<LinearLayout 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"
android:orientation="vertical"
android:gravity="center_horizontal"
tools:context=".WelcomeActivity">
<androidx.viewpager.widget.ViewPager
android:id="@+id/welcome_viewpager"
<androidx.legacy.widget.Space
android:layout_weight="4"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/welcome_page_tab_layout"/>
android:layout_height="0dp"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/welcome_page_tab_layout"
<ImageView
android:id="@+id/welcome_icon"
android:layout_width="128dp"
android:layout_height="128dp"
android:src="@drawable/intro1"
android:padding="8dp"
tools:ignore="contentDescription"/>
<TextView
android:id="@+id/welcome_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/skip_button_top_spacer"
app:tabBackground="@drawable/paging_indicator"
app:tabGravity="center"
app:tabIndicatorHeight="0dp"/>
android:gravity="center"
android:padding="16dp"
android:text="@string/app_name"
android:textSize="22sp"
android:textStyle="bold"/>
<androidx.legacy.widget.Space
android:id="@+id/skip_button_top_spacer"
<TextView
android:id="@+id/welcome_sub_header"
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintBottom_toTopOf="@id/skip_button"/>
android:layout_height="wrap_content"
android:gravity="center"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="24dp"
android:text="@string/welcome_intro1_message"
android:textSize="18sp"/>
<Button
style="@style/ButtonPrimary"
android:id="@+id/skip_button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="@string/welcome_start_messaging"
app:layout_constraintBottom_toTopOf="@id/skip_button_bottom_spacer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
android:text="@string/welcome_start_messaging" />
<androidx.legacy.widget.Space
android:id="@+id/skip_button_bottom_spacer"
android:layout_weight="5"
android:layout_width="match_parent"
android:layout_height="32dp"
app:layout_constraintBottom_toTopOf="@id/backup_text"/>
android:layout_height="0dp"/>
<TextView
android:id="@+id/backup_text"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:paddingBottom="20dp"
android:gravity="center"
android:text="@string/import_backup_title"
android:textColor="@color/delta_accent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/backup_icon"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"/>
android:textSize="16sp"
android:textColor="@color/delta_accent"/>
<ImageView
android:id="@+id/backup_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="8dp"
android:src="@drawable/ic_folder_white_48dp"
android:tint="@color/delta_accent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/backup_text"
app:layout_constraintTop_toBottomOf="@id/skip_button_bottom_spacer"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
-49
View File
@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".WelcomeActivity">
<ImageView
android:id="@+id/welcome_icon"
android:layout_width="128dp"
android:layout_height="128dp"
android:contentDescription="TODO"
android:padding="8dp"
app:layout_constraintBottom_toTopOf="@id/welcome_header"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"/>
<TextView
android:id="@+id/welcome_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp"
android:text="Delta bla"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/welcome_sub_header"
app:layout_constraintTop_toBottomOf="@id/welcome_icon"
app:layout_constraintVertical_chainStyle="packed"/>
<TextView
android:id="@+id/welcome_sub_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="24dp"
android:text="dfajsdjasjd djj lorem ispuim dolor sit amentnet 32"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/welcome_header"
app:layout_constraintVertical_chainStyle="packed"/>
</androidx.constraintlayout.widget.ConstraintLayout>
-13
View File
@@ -308,20 +308,7 @@
<!-- welcome and login -->
<string name="welcome_intro1_headline">Delta Chat</string>
<string name="welcome_intro1_message">The messenger with the broadest audience in the world. Free and independent.</string>
<string name="welcome_intro2_headline">Independent</string>
<string name="welcome_intro2_message">There is no Delta Chat server. The app only uses your mail server.</string>
<string name="welcome_intro3_headline">Fast</string>
<string name="welcome_intro3_message">Push messages in seconds.\nRapid interface.</string>
<string name="welcome_intro4_headline">Powerful</string>
<string name="welcome_intro4_message">Unlimited chats, images, videos, audio messages and more. Multi-client capable.</string>
<string name="welcome_intro5_headline">Free</string>
<string name="welcome_intro5_message">Delta Chat is a free software. No ad or subscription. No vendor lock-in.</string>
<string name="welcome_intro6_headline">Encrypted</string>
<string name="welcome_intro6_message">Encrypted with all common algorithms. Messages stay on your servers.</string>
<string name="welcome_intro7_headline">Trustworthy</string>
<string name="welcome_intro7_message">Delta Chat is safe for business use, compatible and standards-based.</string>
<string name="welcome_start_messaging">Start messaging</string>
<string name="login_title">Log in</string>
<string name="login_header">Log in to your server</string>
@@ -28,63 +28,8 @@ import org.thoughtcrime.securesms.util.views.ProgressDialog;
import java.io.File;
/**
* The welcome activity. Provides the user with useful information about the app.
* It also allows the triggering of the backup import process.
*
* @author Daniel Böhrs
*/
public class WelcomeActivity extends BaseActionBarActivity implements DcEventCenter.DcEventDelegate {
private class WelcomePagerAdapter extends PagerAdapter {
private static final int PAGE_COUNT = 7;
private Context context;
private int icons[] = new int[]{R.drawable.intro1, R.drawable.intro2, R.drawable.intro3, R.drawable.intro4, R.drawable.intro5, R.drawable.intro6, R.drawable.intro7};
private int titles[] = new int[]{R.string.welcome_intro1_headline, R.string.welcome_intro2_headline, R.string.welcome_intro3_headline, R.string.welcome_intro4_headline, R.string.welcome_intro5_headline, R.string.welcome_intro6_headline, R.string.welcome_intro7_headline};
private int messages[] = new int[]{R.string.welcome_intro1_message, R.string.welcome_intro2_message, R.string.welcome_intro3_message, R.string.welcome_intro4_message, R.string.welcome_intro5_message, R.string.welcome_intro6_message, R.string.welcome_intro7_message};
WelcomePagerAdapter(Context context) {
this.context = context;
}
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
LayoutInflater inflater = LayoutInflater.from(context);
ViewGroup layout = (ViewGroup) inflater.inflate(R.layout.welcome_page, container, false);
TextView welcomeHeader = layout.findViewById(R.id.welcome_header);
welcomeHeader.setText(titles[position]);
TextView welcomeSubHeader = layout.findViewById(R.id.welcome_sub_header);
welcomeSubHeader.setText(messages[position]);
ImageView welcomeIcon = layout.findViewById(R.id.welcome_icon);
welcomeIcon.setImageResource(icons[position]);
container.addView(layout);
return layout;
}
@Override
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
container.removeView((View) object);
}
@Override
public int getCount() {
return PAGE_COUNT;
}
@Override
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
return view == object;
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
@@ -93,8 +38,8 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
initializeResources();
ApplicationDcContext dcContext = DcHelper.getContext(this);
dcContext.eventCenter.addObserver(this, DcContext.DC_EVENT_CONFIGURE_PROGRESS);
dcContext.eventCenter.addObserver(this, DcContext.DC_EVENT_IMEX_PROGRESS);
dcContext.eventCenter.addObserver(DcContext.DC_EVENT_CONFIGURE_PROGRESS, this);
dcContext.eventCenter.addObserver(DcContext.DC_EVENT_IMEX_PROGRESS, this);
}
@Override
@@ -109,16 +54,10 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
}
private void initializeResources() {
ViewPager viewPager = findViewById(R.id.welcome_viewpager);
viewPager.setAdapter(new WelcomePagerAdapter(this));
TabLayout tabLayout = findViewById(R.id.welcome_page_tab_layout);
tabLayout.setupWithViewPager(viewPager, true);
Button skipButton = findViewById(R.id.skip_button);
View backupText = findViewById(R.id.backup_text);
View backupImage = findViewById(R.id.backup_icon);
skipButton.setOnClickListener((view) -> startRegistrationActivity());
backupText.setOnClickListener((view) -> startImportBackup());
backupImage.setOnClickListener((view) -> startImportBackup());
}
private void startRegistrationActivity() {