manage_feeds: add SubscribeToFeedActivity and basic ui skeleton
authorDa Risk <da_risk@geekorum.com>
Tue, 02 Jul 2019 10:35:23 -0700
changeset 327 47550af40894
parent 326 f4891e8ee141
child 328 164b6365e14f
manage_feeds: add SubscribeToFeedActivity and basic ui skeleton
manage_feeds/src/main/java/com/geekorum/ttrss/manage_feeds/add_feed/SubscribeToFeedActivity.kt
manage_feeds/src/main/res/layout/activity_subscribe_to_feed.xml
manage_feeds/src/main/res/navigation/subscribe_to_feed.xml
manage_feeds/src/main/res/values/strings.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/manage_feeds/src/main/java/com/geekorum/ttrss/manage_feeds/add_feed/SubscribeToFeedActivity.kt	Tue Jul 02 10:35:23 2019 -0700
@@ -0,0 +1,54 @@
+/*
+ * Geekttrss is a RSS feed reader application on the Android Platform.
+ *
+ * Copyright (C) 2017-2019 by Frederic-Charles Barthelery.
+ *
+ * This file is part of Geekttrss.
+ *
+ * Geekttrss 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.
+ *
+ * Geekttrss 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 Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.geekorum.ttrss.manage_feeds.add_feed
+
+import android.os.Bundle
+import androidx.databinding.DataBindingUtil
+import androidx.navigation.NavController
+import androidx.navigation.findNavController
+import com.geekorum.ttrss.applicationComponent
+import com.geekorum.ttrss.manage_feeds.DaggerManageFeedComponent
+import com.geekorum.ttrss.manage_feeds.R
+import com.geekorum.ttrss.manage_feeds.databinding.ActivitySubscribeToFeedBinding
+import com.geekorum.ttrss.session.SessionActivity
+import com.geekorum.ttrss.viewModels
+
+
+class SubscribeToFeedActivity : SessionActivity() {
+
+    private lateinit var binding: ActivitySubscribeToFeedBinding
+    private val viewModel: SubscribeToFeedViewModel by viewModels()
+    private val navController: NavController by lazy {
+        findNavController(R.id.nav_host_fragment)
+    }
+
+    override fun inject() {
+        val manageFeedComponent = DaggerManageFeedComponent.builder()
+            .manageFeedsDependencies(applicationComponent)
+            .build()
+        manageFeedComponent.activityInjector.inject(this)
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        binding = DataBindingUtil.setContentView(this, R.layout.activity_subscribe_to_feed)
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/manage_feeds/src/main/res/layout/activity_subscribe_to_feed.xml	Tue Jul 02 10:35:23 2019 -0700
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+    Geekttrss is a RSS feed reader application on the Android Platform.
+
+    Copyright (C) 2017-2019 by Frederic-Charles Barthelery.
+
+    This file is part of Geekttrss.
+
+    Geekttrss 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.
+
+    Geekttrss 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 Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
+
+-->
+<layout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <data>
+
+    </data>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+        <com.google.android.material.appbar.AppBarLayout
+                android:id="@+id/app_bar"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/app_bar_height"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:liftOnScroll="true">
+
+            <com.google.android.material.appbar.CollapsingToolbarLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
+                    app:title="Add Feed"
+                    style="?appBarCollapsingToolbarStyle">
+
+                <com.google.android.material.appbar.MaterialToolbar
+                        android:layout_width="match_parent"
+                        android:layout_height="84dp"
+                        app:layout_collapseMode="pin"
+                        />
+
+            </com.google.android.material.appbar.CollapsingToolbarLayout>
+
+        </com.google.android.material.appbar.AppBarLayout>
+
+
+        <fragment android:id="@+id/nav_host_fragment"
+                android:name="androidx.navigation.fragment.NavHostFragment"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/app_bar"
+                app:layout_constraintBottom_toTopOf="@id/next"
+                app:defaultNavHost="true"
+                app:navGraph="@navigation/subscribe_to_feed" />
+
+
+        <Button android:id="@+id/next"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                android:layout_marginEnd="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginBottom="8dp"
+                android:text="@string/activity_subscribe_feed_btn_subscribe" />
+
+
+        <Button android:id="@+id/cancel"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                android:layout_marginStart="8dp"
+                android:layout_marginBottom="8dp"
+                android:text="@string/activity_subscribe_feed_btn_cancel"
+                style="@style/Widget.MaterialComponents.Button.TextButton" />
+
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/manage_feeds/src/main/res/navigation/subscribe_to_feed.xml	Tue Jul 02 10:35:23 2019 -0700
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+    Geekttrss is a RSS feed reader application on the Android Platform.
+
+    Copyright (C) 2017-2019 by Frederic-Charles Barthelery.
+
+    This file is part of Geekttrss.
+
+    Geekttrss 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.
+
+    Geekttrss 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 Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
+
+-->
+<navigation 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:id="@+id/subscribe_to_feed"
+        >
+
+</navigation>
--- a/manage_feeds/src/main/res/values/strings.xml	Tue Jul 02 09:53:12 2019 -0700
+++ b/manage_feeds/src/main/res/values/strings.xml	Tue Jul 02 10:35:23 2019 -0700
@@ -37,4 +37,8 @@
     <string name="activity_add_feed_account_subtitle">Account</string>
     <string name="activity_add_feed_btn_subscribe">Subscribe</string>
 
+    <!-- activity subscribe to feed -->
+    <string name="activity_subscribe_feed_btn_subscribe">Subscribe</string>
+    <string name="activity_subscribe_feed_btn_cancel">Cancel</string>
+
 </resources>