mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 07:08:25 +00:00
Ditch RSS feeds for now
This commit is contained in:
parent
09871b7c50
commit
dda578bef8
@ -73,6 +73,32 @@
|
|||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_alignParentBottom="true" />
|
android:layout_alignParentBottom="true" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyStateContainer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="32dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_centerInParent="true">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:text="You don't have any contacts yet" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style="@style/MediumProminentOutlineButton"
|
||||||
|
android:id="@+id/createNewPrivateChatButton"
|
||||||
|
android:layout_width="196dp"
|
||||||
|
android:layout_height="@dimen/medium_button_height"
|
||||||
|
android:layout_marginTop="@dimen/medium_spacing"
|
||||||
|
android:text="Start a Session" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -69,8 +69,8 @@ import org.thoughtcrime.securesms.loki.redesign.activities.HomeActivity;
|
|||||||
import org.thoughtcrime.securesms.loki.redesign.messaging.BackgroundOpenGroupPollWorker;
|
import org.thoughtcrime.securesms.loki.redesign.messaging.BackgroundOpenGroupPollWorker;
|
||||||
import org.thoughtcrime.securesms.loki.redesign.messaging.BackgroundPollWorker;
|
import org.thoughtcrime.securesms.loki.redesign.messaging.BackgroundPollWorker;
|
||||||
import org.thoughtcrime.securesms.loki.redesign.messaging.LokiAPIDatabase;
|
import org.thoughtcrime.securesms.loki.redesign.messaging.LokiAPIDatabase;
|
||||||
import org.thoughtcrime.securesms.loki.redesign.messaging.LokiRSSFeedPoller;
|
|
||||||
import org.thoughtcrime.securesms.loki.redesign.messaging.LokiUserDatabase;
|
import org.thoughtcrime.securesms.loki.redesign.messaging.LokiUserDatabase;
|
||||||
|
import org.thoughtcrime.securesms.loki.redesign.shelved.LokiRSSFeedPoller;
|
||||||
import org.thoughtcrime.securesms.loki.redesign.utilities.Broadcaster;
|
import org.thoughtcrime.securesms.loki.redesign.utilities.Broadcaster;
|
||||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||||
@ -111,7 +111,6 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -534,8 +533,10 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void createRSSFeedsIfNeeded() {
|
public void createRSSFeedsIfNeeded() {
|
||||||
|
return;
|
||||||
|
/*
|
||||||
ArrayList<LokiRSSFeed> feeds = new ArrayList<>();
|
ArrayList<LokiRSSFeed> feeds = new ArrayList<>();
|
||||||
// feeds.add(lokiNewsFeed());
|
feeds.add(lokiNewsFeed());
|
||||||
feeds.add(lokiMessengerUpdatesFeed());
|
feeds.add(lokiMessengerUpdatesFeed());
|
||||||
for (LokiRSSFeed feed : feeds) {
|
for (LokiRSSFeed feed : feeds) {
|
||||||
boolean isFeedSetUp = TextSecurePreferences.isChatSetUp(this, feed.getId());
|
boolean isFeedSetUp = TextSecurePreferences.isChatSetUp(this, feed.getId());
|
||||||
@ -544,9 +545,12 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
TextSecurePreferences.markChatSetUp(this, feed.getId());
|
TextSecurePreferences.markChatSetUp(this, feed.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createRSSFeedPollersIfNeeded() {
|
private void createRSSFeedPollersIfNeeded() {
|
||||||
|
return;
|
||||||
|
/*
|
||||||
// Only create the RSS feed pollers if their threads aren't deleted
|
// Only create the RSS feed pollers if their threads aren't deleted
|
||||||
LokiRSSFeed lokiNewsFeed = lokiNewsFeed();
|
LokiRSSFeed lokiNewsFeed = lokiNewsFeed();
|
||||||
long lokiNewsFeedThreadID = GroupManager.getRSSFeedThreadId(lokiNewsFeed.getId(), this);
|
long lokiNewsFeedThreadID = GroupManager.getRSSFeedThreadId(lokiNewsFeed.getId(), this);
|
||||||
@ -562,6 +566,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
if (lokiMessengerUpdatesFeedPoller == null) {
|
if (lokiMessengerUpdatesFeedPoller == null) {
|
||||||
lokiMessengerUpdatesFeedPoller = new LokiRSSFeedPoller(this, lokiMessengerUpdatesFeed());
|
lokiMessengerUpdatesFeedPoller = new LokiRSSFeedPoller(this, lokiMessengerUpdatesFeed());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpThreadDeletionListeners(long threadID, Runnable onDelete) {
|
private void setUpThreadDeletionListeners(long threadID, Runnable onDelete) {
|
||||||
@ -586,9 +591,12 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startRSSFeedPollersIfNeeded() {
|
public void startRSSFeedPollersIfNeeded() {
|
||||||
|
return;
|
||||||
|
/*
|
||||||
createRSSFeedPollersIfNeeded();
|
createRSSFeedPollersIfNeeded();
|
||||||
if (lokiNewsFeedPoller != null) lokiNewsFeedPoller.startIfNeeded();
|
if (lokiNewsFeedPoller != null) lokiNewsFeedPoller.startIfNeeded();
|
||||||
if (lokiMessengerUpdatesFeedPoller != null) lokiMessengerUpdatesFeedPoller.startIfNeeded();
|
if (lokiMessengerUpdatesFeedPoller != null) lokiMessengerUpdatesFeedPoller.startIfNeeded();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resubmitProfilePictureIfNeeded() {
|
private void resubmitProfilePictureIfNeeded() {
|
||||||
|
@ -112,6 +112,8 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|||||||
recyclerView.adapter = homeAdapter
|
recyclerView.adapter = homeAdapter
|
||||||
recyclerView.layoutManager = LinearLayoutManager(this)
|
recyclerView.layoutManager = LinearLayoutManager(this)
|
||||||
ItemTouchHelper(SwipeCallback(this)).attachToRecyclerView(recyclerView)
|
ItemTouchHelper(SwipeCallback(this)).attachToRecyclerView(recyclerView)
|
||||||
|
// Set up empty state view
|
||||||
|
createNewPrivateChatButton.setOnClickListener { createNewPrivateChat() }
|
||||||
// This is a workaround for the fact that CursorRecyclerViewAdapter doesn't actually auto-update (even though it says it will)
|
// This is a workaround for the fact that CursorRecyclerViewAdapter doesn't actually auto-update (even though it says it will)
|
||||||
LoaderManager.getInstance(this).restartLoader(0, null, object : LoaderManager.LoaderCallbacks<Cursor> {
|
LoaderManager.getInstance(this).restartLoader(0, null, object : LoaderManager.LoaderCallbacks<Cursor> {
|
||||||
|
|
||||||
@ -121,6 +123,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|||||||
|
|
||||||
override fun onLoadFinished(loader: Loader<Cursor>, cursor: Cursor?) {
|
override fun onLoadFinished(loader: Loader<Cursor>, cursor: Cursor?) {
|
||||||
homeAdapter.changeCursor(cursor)
|
homeAdapter.changeCursor(cursor)
|
||||||
|
updateEmptyState()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoaderReset(cursor: Loader<Cursor>) {
|
override fun onLoaderReset(cursor: Loader<Cursor>) {
|
||||||
@ -181,6 +184,14 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
|
|||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
// region Updating
|
||||||
|
private fun updateEmptyState() {
|
||||||
|
val threadCount = (recyclerView.adapter as HomeAdapter).itemCount
|
||||||
|
emptyStateContainer.visibility = if (threadCount == 0) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Interaction
|
||||||
override fun handleSeedReminderViewContinueButtonTapped() {
|
override fun handleSeedReminderViewContinueButtonTapped() {
|
||||||
val intent = Intent(this, SeedActivity::class.java)
|
val intent = Intent(this, SeedActivity::class.java)
|
||||||
show(intent)
|
show(intent)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package org.thoughtcrime.securesms.loki.redesign.messaging
|
package org.thoughtcrime.securesms.loki.redesign.shelved
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Handler
|
import android.os.Handler
|
Loading…
x
Reference in New Issue
Block a user