mirror of https://github.com/kurisufriend/Clover
commit
b82944cf7f
@ -1,38 +0,0 @@ |
|||||||
/* |
|
||||||
* Clover - 4chan browser https://github.com/Floens/Clover/
|
|
||||||
* Copyright (C) 2014 Floens |
|
||||||
* |
|
||||||
* This program is free software: you can redistribute it and/or modify |
|
||||||
* it under the terms of the GNU General Public License as published by |
|
||||||
* the Free Software Foundation, either version 3 of the License, or |
|
||||||
* (at your option) any later version. |
|
||||||
* |
|
||||||
* This program is distributed in the hope that it will be useful, |
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
* GNU General Public License for more details. |
|
||||||
* |
|
||||||
* You should have received a copy of the GNU General Public License |
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/ |
|
||||||
package org.floens.chan.core.presenter; |
|
||||||
|
|
||||||
public class SetupPresenter { |
|
||||||
private Callback callback; |
|
||||||
|
|
||||||
public void create(Callback callback) { |
|
||||||
this.callback = callback; |
|
||||||
|
|
||||||
callback.moveToIntro(); |
|
||||||
} |
|
||||||
|
|
||||||
public void startClicked() { |
|
||||||
callback.moveToSiteSetup(); |
|
||||||
} |
|
||||||
|
|
||||||
public interface Callback { |
|
||||||
void moveToIntro(); |
|
||||||
|
|
||||||
void moveToSiteSetup(); |
|
||||||
} |
|
||||||
} |
|
@ -1,51 +0,0 @@ |
|||||||
/* |
|
||||||
* Clover - 4chan browser https://github.com/Floens/Clover/
|
|
||||||
* Copyright (C) 2014 Floens |
|
||||||
* |
|
||||||
* This program is free software: you can redistribute it and/or modify |
|
||||||
* it under the terms of the GNU General Public License as published by |
|
||||||
* the Free Software Foundation, either version 3 of the License, or |
|
||||||
* (at your option) any later version. |
|
||||||
* |
|
||||||
* This program is distributed in the hope that it will be useful, |
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
* GNU General Public License for more details. |
|
||||||
* |
|
||||||
* You should have received a copy of the GNU General Public License |
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/ |
|
||||||
package org.floens.chan.ui.controller; |
|
||||||
|
|
||||||
import android.content.Context; |
|
||||||
import android.view.View; |
|
||||||
import android.widget.Button; |
|
||||||
|
|
||||||
import org.floens.chan.R; |
|
||||||
import org.floens.chan.controller.Controller; |
|
||||||
|
|
||||||
public class IntroController extends Controller implements View.OnClickListener { |
|
||||||
private Button start; |
|
||||||
|
|
||||||
public IntroController(Context context) { |
|
||||||
super(context); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void onCreate() { |
|
||||||
super.onCreate(); |
|
||||||
|
|
||||||
view = inflateRes(R.layout.controller_intro); |
|
||||||
|
|
||||||
start = view.findViewById(R.id.start); |
|
||||||
start.setOnClickListener(this); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void onClick(View v) { |
|
||||||
if (v == start) { |
|
||||||
((SitesSetupController) presentedByController).onIntroDismissed(); |
|
||||||
stopPresenting(); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,84 +0,0 @@ |
|||||||
/* |
|
||||||
* Clover - 4chan browser https://github.com/Floens/Clover/
|
|
||||||
* Copyright (C) 2014 Floens |
|
||||||
* |
|
||||||
* This program is free software: you can redistribute it and/or modify |
|
||||||
* it under the terms of the GNU General Public License as published by |
|
||||||
* the Free Software Foundation, either version 3 of the License, or |
|
||||||
* (at your option) any later version. |
|
||||||
* |
|
||||||
* This program is distributed in the hope that it will be useful, |
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
* GNU General Public License for more details. |
|
||||||
* |
|
||||||
* You should have received a copy of the GNU General Public License |
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/ |
|
||||||
package org.floens.chan.ui.controller; |
|
||||||
|
|
||||||
import android.content.Context; |
|
||||||
import android.view.animation.DecelerateInterpolator; |
|
||||||
|
|
||||||
import org.floens.chan.R; |
|
||||||
import org.floens.chan.controller.Controller; |
|
||||||
import org.floens.chan.controller.transition.FadeInTransition; |
|
||||||
import org.floens.chan.core.presenter.SetupPresenter; |
|
||||||
import org.floens.chan.ui.theme.ThemeHelper; |
|
||||||
import org.floens.chan.ui.toolbar.Toolbar; |
|
||||||
|
|
||||||
public class SetupController extends ToolbarNavigationController implements SetupPresenter.Callback { |
|
||||||
private SetupPresenter presenter; |
|
||||||
|
|
||||||
public SetupController(Context context) { |
|
||||||
super(context); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void onCreate() { |
|
||||||
super.onCreate(); |
|
||||||
|
|
||||||
view = inflateRes(R.layout.controller_navigation_setup); |
|
||||||
container = view.findViewById(R.id.container); |
|
||||||
toolbar = view.findViewById(R.id.toolbar); |
|
||||||
toolbar.setArrowMenuIconShown(false); |
|
||||||
toolbar.setBackgroundColor(ThemeHelper.getInstance().getTheme().primaryColor.color); |
|
||||||
toolbar.setCallback(new Toolbar.SimpleToolbarCallback() { |
|
||||||
@Override |
|
||||||
public void onMenuOrBackClicked(boolean isArrow) { |
|
||||||
} |
|
||||||
}); |
|
||||||
toolbar.setAlpha(0f); |
|
||||||
requireSpaceForToolbar = false; |
|
||||||
|
|
||||||
presenter = new SetupPresenter(); |
|
||||||
presenter.create(this); |
|
||||||
} |
|
||||||
|
|
||||||
public SetupPresenter getPresenter() { |
|
||||||
return presenter; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void moveToIntro() { |
|
||||||
replaceController(new IntroController(context), false); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void moveToSiteSetup() { |
|
||||||
SitesSetupController sitesSetupController = new SitesSetupController(context); |
|
||||||
sitesSetupController.showDoneCheckmark(); |
|
||||||
replaceController(sitesSetupController, true); |
|
||||||
} |
|
||||||
|
|
||||||
private void replaceController(Controller to, boolean showToolbar) { |
|
||||||
if (blockingInput || toolbar.isTransitioning()) return; |
|
||||||
|
|
||||||
boolean animated = getTop() != null; |
|
||||||
|
|
||||||
transition(getTop(), to, true, animated ? new FadeInTransition() : null); |
|
||||||
|
|
||||||
toolbar.animate().alpha(showToolbar ? 1f : 0f) |
|
||||||
.setInterpolator(new DecelerateInterpolator(2f)).start(); |
|
||||||
} |
|
||||||
} |
|
Before Width: | Height: | Size: 46 KiB |
@ -1,90 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?><!-- |
|
||||||
Clover - 4chan browser https://github.com/Floens/Clover/ |
|
||||||
Copyright (C) 2014 Floens |
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU General Public License as published by |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License |
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||||
--> |
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|
||||||
android:layout_width="match_parent" |
|
||||||
android:layout_height="match_parent" |
|
||||||
android:background="?backcolor" |
|
||||||
android:orientation="vertical"> |
|
||||||
|
|
||||||
<ImageView |
|
||||||
android:id="@+id/logo" |
|
||||||
android:layout_width="match_parent" |
|
||||||
android:layout_height="0dp" |
|
||||||
android:layout_margin="16dp" |
|
||||||
android:layout_marginBottom="8dp" |
|
||||||
android:layout_marginEnd="8dp" |
|
||||||
android:layout_marginStart="8dp" |
|
||||||
android:layout_marginTop="8dp" |
|
||||||
android:layout_weight="1" |
|
||||||
android:gravity="center" |
|
||||||
android:src="@drawable/logo" |
|
||||||
app:layout_constraintBottom_toTopOf="@+id/guideline" |
|
||||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||||
app:layout_constraintStart_toStartOf="parent" |
|
||||||
app:layout_constraintTop_toTopOf="parent" |
|
||||||
app:layout_constraintVertical_bias="1.0" /> |
|
||||||
|
|
||||||
<android.support.constraint.Guideline |
|
||||||
android:id="@+id/guideline" |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="0dp" |
|
||||||
android:orientation="horizontal" |
|
||||||
app:layout_constraintBottom_toBottomOf="parent" |
|
||||||
app:layout_constraintGuide_percent="0.45" /> |
|
||||||
|
|
||||||
<TextView |
|
||||||
android:id="@+id/title" |
|
||||||
style="@style/TextAppearance.AppCompat.Display1" |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:layout_marginEnd="8dp" |
|
||||||
android:layout_marginStart="8dp" |
|
||||||
android:layout_marginTop="8dp" |
|
||||||
android:text="@string/intro_title" |
|
||||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||||
app:layout_constraintStart_toStartOf="parent" |
|
||||||
app:layout_constraintTop_toTopOf="@+id/guideline" /> |
|
||||||
|
|
||||||
<TextView |
|
||||||
android:id="@+id/content" |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:layout_marginEnd="8dp" |
|
||||||
android:layout_marginStart="8dp" |
|
||||||
android:layout_marginTop="8dp" |
|
||||||
android:text="@string/intro_content" |
|
||||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||||
app:layout_constraintStart_toStartOf="parent" |
|
||||||
app:layout_constraintTop_toBottomOf="@+id/title" /> |
|
||||||
|
|
||||||
<Button |
|
||||||
android:id="@+id/start" |
|
||||||
style="@style/Widget.AppCompat.Button" |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:layout_marginBottom="32dp" |
|
||||||
android:layout_marginEnd="8dp" |
|
||||||
android:layout_marginStart="8dp" |
|
||||||
android:foreground="?selectableItemBackground" |
|
||||||
android:text="@string/intro_start" |
|
||||||
app:layout_constraintBottom_toBottomOf="parent" |
|
||||||
app:layout_constraintEnd_toEndOf="parent" |
|
||||||
app:layout_constraintStart_toStartOf="parent" /> |
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout> |
|
@ -0,0 +1,61 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<android.support.constraint.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"> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/header" |
||||||
|
style="@style/TextAppearance.AppCompat.Headline" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginEnd="8dp" |
||||||
|
android:layout_marginLeft="8dp" |
||||||
|
android:layout_marginRight="8dp" |
||||||
|
android:layout_marginStart="8dp" |
||||||
|
android:layout_marginTop="8dp" |
||||||
|
android:text="@string/thread_empty_setup_title" |
||||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||||
|
app:layout_constraintStart_toStartOf="parent" |
||||||
|
app:layout_constraintTop_toTopOf="@+id/guideline" /> |
||||||
|
|
||||||
|
<android.support.constraint.Guideline |
||||||
|
android:id="@+id/guideline" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:orientation="horizontal" |
||||||
|
app:layout_constraintGuide_percent="0.5" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/body" |
||||||
|
style="@style/TextAppearance.AppCompat.Subhead" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginEnd="8dp" |
||||||
|
android:layout_marginLeft="8dp" |
||||||
|
android:layout_marginRight="8dp" |
||||||
|
android:layout_marginStart="8dp" |
||||||
|
android:layout_marginTop="8dp" |
||||||
|
android:text="@string/thread_empty_setup_body" |
||||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||||
|
app:layout_constraintStart_toStartOf="parent" |
||||||
|
app:layout_constraintTop_toBottomOf="@+id/header" /> |
||||||
|
|
||||||
|
<TextView |
||||||
|
android:id="@+id/feature" |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:layout_marginBottom="16dp" |
||||||
|
android:layout_marginEnd="8dp" |
||||||
|
android:layout_marginLeft="8dp" |
||||||
|
android:layout_marginRight="8dp" |
||||||
|
android:layout_marginStart="8dp" |
||||||
|
android:text="@string/thread_empty_setup_feature" |
||||||
|
android:textSize="50dp" |
||||||
|
app:layout_constraintBottom_toTopOf="@+id/header" |
||||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||||
|
app:layout_constraintStart_toStartOf="parent" |
||||||
|
tools:ignore="SpUsage" /> |
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout> |
Loading…
Reference in new issue