Class NewsfeedDetailsActivity<A extends NewsfeedDetailsAdapter,V extends NewsfeedDetailsView,P extends NewsfeedDetailsPresenter<V>>
- java.lang.Object
-
- android.content.Context
-
- android.content.ContextWrapper
-
- android.view.ContextThemeWrapper
-
- android.app.Activity
-
- androidx.core.app.ComponentActivity
-
- androidx.activity.ComponentActivity
-
- androidx.fragment.app.FragmentActivity
-
- androidx.appcompat.app.AppCompatActivity
-
- com.cheetahdigital.uikit.application.BaseActivity
-
- com.cheetahdigital.uikit.application.ThemedActivity
-
- com.cheetahdigital.uikit.architecture.mvp.MvpActivityView<V,P>
-
- com.cheetahdigital.uikit.architecture.lce.LceActivityView<V,P>
-
- com.cheetahdigital.uikit.architecture.lce.ToolbarLceActivityView<V,P>
-
- com.cheetahdigital.uikit.architecture.refreshable.RefreshableActivityView<V,P>
-
- com.cheetahdigital.uikit.widget.list.ListActivityView<V,P>
-
- com.cheetahdigital.uikit.widget.list.EndlessListActivityView<A,V,P>
-
- com.cheetahdigital.newsfeed.ui.details.NewsfeedDetailsActivity<A,V,P>
-
- All Implemented Interfaces:
android.content.ComponentCallbacks
,android.content.ComponentCallbacks2
,android.view.KeyEvent.Callback
,android.view.LayoutInflater.Factory
,android.view.LayoutInflater.Factory2
,android.view.View.OnCreateContextMenuListener
,android.view.Window.Callback
,androidx.activity.OnBackPressedDispatcherOwner
,androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider
,androidx.appcompat.app.AppCompatCallback
,androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
,androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator
,androidx.core.app.TaskStackBuilder.SupportParentable
,androidx.core.view.KeyEventDispatcher.Component
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
,AnalyticsManager.AnalyticsScreen
,CommentClickListener
,NewsfeedDetailsView
,PostDetailsClickListener
,LceView
,MvpLceView
,MvpView
,RefreshableView
,FacebookHelper.FacebookShareCallBack
,EndlessListView
,ListView
public class NewsfeedDetailsActivity<A extends NewsfeedDetailsAdapter,V extends NewsfeedDetailsView,P extends NewsfeedDetailsPresenter<V>> extends EndlessListActivityView<A,V,P> implements NewsfeedDetailsView, FacebookHelper.FacebookShareCallBack, PostDetailsClickListener, CommentClickListener
Activity that shows the details of aPost
. Details include the post, user comments, number of likes and flag label. Can receive the following intent extras:IntentKey.PRIMARY_ID
- thePost
id to loadIntentKey.PRIMARY_PARAMS
- theNewsfeedParams
for postIntentKey.SECONDARY_PARAMS
- theNewsfeedParams
for commentIntentKey.TERTIARY_PARAMS
- theNewsfeedParams
for flagKEY_POST_ID
- used for result dataKEY_USER_ALLOWED_TO_COMMENT
- Key for receiving the status if the user is allowed to comment or not. This controls the visibility of the comment view inSocialWidget
KEY_USER_ALLOW_POST
- Key for receiving the status if the user is allowed to post or not. This controls the visibility of the new post iconKEY_ON_COMMENTS
- Key that determines if keyboard should be displayed or hidden once the screen is openedPUBLIC_PROFILE_CLICKABLE
- boolean key to allow clicking of member avatar/name in a post or comment to show their profile
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
KEY_ON_COMMENTS
static java.lang.String
KEY_POST_ID
static java.lang.String
KEY_USER_ALLOW_POST
static java.lang.String
KEY_USER_ALLOWED_TO_COMMENT
static java.lang.String
PUBLIC_PROFILE_CLICKABLE
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.EndlessListActivityView
mEndlessRecyclerOnScrollListener
-
Fields inherited from class com.cheetahdigital.uikit.widget.list.ListActivityView
mLinearLayoutManager, mListView
-
Fields inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshableActivityView
mSwipeRefreshLayout
-
Fields inherited from class com.cheetahdigital.uikit.architecture.lce.ToolbarLceActivityView
mToolbar
-
Fields inherited from class com.cheetahdigital.uikit.architecture.lce.LceActivityView
mContentView, mErrorView, mLoadingView
-
Fields inherited from class android.app.Activity
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK
-
Fields inherited from class android.content.Context
ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_IMPORTANT, BIND_INCLUDE_CAPABILITIES, BIND_NOT_FOREGROUND, BIND_NOT_PERCEPTIBLE, BIND_WAIVE_PRIORITY, BIOMETRIC_SERVICE, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, COMPANION_DEVICE_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, CROSS_PROFILE_APPS_SERVICE, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, EUICC_SERVICE, FINGERPRINT_SERVICE, HARDWARE_PROPERTIES_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, IPSEC_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_STATS_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, RECEIVER_VISIBLE_TO_INSTANT_APPS, RESTRICTIONS_SERVICE, ROLE_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SHORTCUT_SERVICE, STORAGE_SERVICE, STORAGE_STATS_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_CLASSIFICATION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_AWARE_SERVICE, WIFI_P2P_SERVICE, WIFI_RTT_RANGING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE
-
-
Constructor Summary
Constructors Constructor Description NewsfeedDetailsActivity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendComments(java.util.List<Comment> comments, int totalEntries)
Notifies the view to append list ofComment
to the existing comment list.void
clearCommentEditText()
Notifies the view to clear the content of Comment Edit Text.protected NewsfeedDetailsAdapter
createAdapter()
Create the adapter used in current RecycleView present.protected androidx.recyclerview.widget.RecyclerView.ItemDecoration
createItemDecoration()
Create the item decoration used in the RecyclerView.protected P
createPresenter()
Presenter forNewsfeedDetailsActivity
void
deleteComment(int commentId)
Notifies the view to delete the comment from the existing list.void
deletePost()
Notifies the view to delete the Post.protected int
getContentLayoutId()
Layout view forNewsfeedDetailsActivity
int
getScreenName()
Returns the screen name to display.void
hideRefreshProgress()
Notifies the view to hide refresh progress.void
onCommentClick(Post post)
Method to handle clicking of comment viewvoid
onCommentLaunchProfile(Commenter commenter)
Method to handle launching of the Commenter's Profileprotected void
onCreate(android.os.Bundle savedInstanceState)
void
onDeleteComment(int commentId)
Method to handle deleting of commentvoid
onDeletePost()
Method to handle deleting of postvoid
onFacebookShareCancelled()
void
onFacebookShareError(com.facebook.FacebookException e)
void
onFacebookShareSuccess(com.facebook.share.Sharer.Result result)
void
onFlagComment(int postId, int commentId, java.lang.String flag)
Method to handle the flagging/unflagging of commentvoid
onFlagNews(int postId, java.lang.String flag)
Method to handle clicking of flag viewvoid
onLikeComment(int postId, boolean isAttemptToLike, int commentId)
Method to handle the liking/unliking of commentvoid
onLikePost(boolean isAttempToLike)
Method to handle liking of Postvoid
onLinkPreviewClick(Post post)
Method to handle clicking of link previewvoid
onNewsLaunchProfile(Owner owner)
Method to handle launching of Owner's profilevoid
onShareUrl(android.net.Uri uri)
Method to handle sharing of urlvoid
onViewUrl(android.net.Uri uri)
Method to handle viewing of urlvoid
revertCommentChanges(java.lang.String error, int commentId)
Notifies the view to revert any changes made to the comment associated to the post.void
revertPostChanges(java.lang.String error)
Notifies the view to revert any changes made to the post.protected void
setCommentEditTextWatcher(android.text.TextWatcher textWatcher)
Set text watcher of comment edit text (R.id.edit_text_comment)protected void
setSendCommentButtonClickListener(android.view.View.OnClickListener listener)
Set click listener of send comment button (R.id.button_send_comment)void
showErrorDialog(java.lang.String error)
Notifies the view to show a dialog with the provided error messagevoid
showNewsDetails(Post post, java.util.List<Comment> comments, int totalEntries, java.util.List<Flag> flag)
void
updateComment(SingleComment comment)
Notifies the view to update a comment from the existing list.void
updatePost(Post post)
Notifies the view to update the Post.-
Methods inherited from class com.cheetahdigital.uikit.widget.list.EndlessListActivityView
onFinishLoadMore, onFinishRefresh, onLoadMoreFailed, setListTotalEntries
-
Methods inherited from class com.cheetahdigital.uikit.architecture.refreshable.RefreshableActivityView
onRefresh, onRefreshFailed, showContent, showError, showLoading, startRefresh
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.ToolbarLceActivityView
getAction, getToolbarNavigationIcon, onOptionsItemSelected
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LceActivityView
onLoadFailed, onLoadSuccess, setErrorViewClickListener
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpActivityView
captureSharedElementValues, getEnterTransition, getExitTransition, getPresenter, getReenterTransition, getReturnTransition, getSharedElementViews, initSharedElementValues, isSharedAnimationEnabled, onDestroy, startActivity, startActivityForResult
-
Methods inherited from class com.cheetahdigital.uikit.application.ThemedActivity
attachBaseContext, getIntentAction, handleShake, isShakeHandlingEnabled, onPause, onResume, registerShakeListener, startActivity, startActivityForResult, unregisterShakeListener
-
Methods inherited from class com.cheetahdigital.uikit.application.BaseActivity
onErrorEvent, onStart, onStop
-
Methods inherited from class androidx.appcompat.app.AppCompatActivity
addContentView, closeOptionsMenu, dispatchKeyEvent, findViewById, getDelegate, getDrawerToggleDelegate, getMenuInflater, getResources, getSupportActionBar, getSupportParentActivityIntent, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreateSupportNavigateUpTaskStack, onKeyDown, onMenuItemSelected, onMenuOpened, onNightModeChanged, onPanelClosed, onPostCreate, onPostResume, onPrepareSupportNavigateUpTaskStack, onSaveInstanceState, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, onWindowStartingSupportActionMode, openOptionsMenu, setContentView, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, setTheme, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask
-
Methods inherited from class androidx.fragment.app.FragmentActivity
dump, getSupportFragmentManager, getSupportLoaderManager, onActivityResult, onAttachFragment, onCreatePanelMenu, onCreateView, onCreateView, onLowMemory, onMultiWindowModeChanged, onNewIntent, onPictureInPictureModeChanged, onPrepareOptionsPanel, onPreparePanel, onRequestPermissionsResult, onResumeFragments, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startActivityFromFragment, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition, validateRequestPermissionsRequestCode
-
Methods inherited from class androidx.activity.ComponentActivity
getLastCustomNonConfigurationInstance, getLifecycle, getOnBackPressedDispatcher, getSavedStateRegistry, getViewModelStore, onBackPressed, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance
-
Methods inherited from class androidx.core.app.ComponentActivity
dispatchKeyShortcutEvent, getExtraData, putExtraData, superDispatchKeyEvent
-
Methods inherited from class android.app.Activity
closeContextMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, enterPictureInPictureMode, enterPictureInPictureMode, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelView, onCreateThumbnail, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onGetDirectActions, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onOptionsMenuClosed, onPerformDirectAction, onPictureInPictureModeChanged, onPostCreate, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onRestart, onRestoreInstanceState, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, overridePendingTransition, postponeEnterTransition, recreate, registerActivityLifecycleCallbacks, registerForContextMenu, releaseInstance, removeDialog, reportFullyDrawn, requestDragAndDropPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, requireViewById, runOnUiThread, setActionBar, setContentTransitionManager, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setInheritShowWhenLocked, setIntent, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setShowWhenLocked, setTaskDescription, setTitle, setTitle, setTitleColor, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivities, startActivities, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderFromChild, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterActivityLifecycleCallbacks, unregisterForContextMenu
-
Methods inherited from class android.view.ContextThemeWrapper
applyOverrideConfiguration, getAssets, getTheme, setTheme
-
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startForegroundService, startInstrumentation, startService, stopService, unbindService, unregisterReceiver, updateServiceGroup
-
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.cheetahdigital.uikit.widget.list.EndlessListView
onFinishLoadMore, onLoadMoreFailed
-
Methods inherited from interface com.cheetahdigital.uikit.architecture.lce.LceView
onLoadFailed, onLoadSuccess, setErrorViewClickListener
-
Methods inherited from interface com.cheetahdigital.uikit.architecture.lce.MvpLceView
showContent, showError, showLoading
-
Methods inherited from interface com.cheetahdigital.uikit.architecture.refreshable.RefreshableView
onFinishRefresh, onRefreshFailed
-
-
-
-
Field Detail
-
KEY_POST_ID
public static final java.lang.String KEY_POST_ID
- See Also:
- Constant Field Values
-
KEY_USER_ALLOWED_TO_COMMENT
public static final java.lang.String KEY_USER_ALLOWED_TO_COMMENT
- See Also:
- Constant Field Values
-
KEY_USER_ALLOW_POST
public static final java.lang.String KEY_USER_ALLOW_POST
- See Also:
- Constant Field Values
-
KEY_ON_COMMENTS
public static final java.lang.String KEY_ON_COMMENTS
- See Also:
- Constant Field Values
-
PUBLIC_PROFILE_CLICKABLE
public static final java.lang.String PUBLIC_PROFILE_CLICKABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
- Overrides:
onCreate
in classEndlessListActivityView<A extends NewsfeedDetailsAdapter,V extends NewsfeedDetailsView,P extends NewsfeedDetailsPresenter<V>>
-
getScreenName
public int getScreenName()
Description copied from class:ThemedActivity
Returns the screen name to display.- Specified by:
getScreenName
in interfaceAnalyticsManager.AnalyticsScreen
- Overrides:
getScreenName
in classThemedActivity
- Returns:
- The screen name used in
AnalyticsManager
that maps this fragment
-
getContentLayoutId
protected int getContentLayoutId()
Layout view forNewsfeedDetailsActivity
- Specified by:
getContentLayoutId
in classMvpActivityView<V extends NewsfeedDetailsView,P extends NewsfeedDetailsPresenter<V>>
- Returns:
- layout id
-
createPresenter
protected P createPresenter()
Presenter forNewsfeedDetailsActivity
- Specified by:
createPresenter
in classMvpActivityView<V extends NewsfeedDetailsView,P extends NewsfeedDetailsPresenter<V>>
- Returns:
- instance of
NewsfeedDetailsPresenter
-
showNewsDetails
public void showNewsDetails(Post post, java.util.List<Comment> comments, int totalEntries, java.util.List<Flag> flag)
Description copied from interface:NewsfeedDetailsView
Notifies the view to show thePost
and list ofComment
. This also means the following API calls were successful:- GET Post
- GET Comments
- GET Flags
- Specified by:
showNewsDetails
in interfaceNewsfeedDetailsView
- Parameters:
post
-Post
objectcomments
- list ofComment
objecttotalEntries
- total number of comments regardless of paginationflag
- list ofFlag
object
-
appendComments
public void appendComments(java.util.List<Comment> comments, int totalEntries)
Description copied from interface:NewsfeedDetailsView
Notifies the view to append list ofComment
to the existing comment list. This also means that the GET comments API with pagination was successful- Specified by:
appendComments
in interfaceNewsfeedDetailsView
- Parameters:
comments
- list ofComment
objecttotalEntries
- total number of comments regardless of pagination
-
deleteComment
public void deleteComment(int commentId)
Description copied from interface:NewsfeedDetailsView
Notifies the view to delete the comment from the existing list. This also means that the delete comment API was successful.- Specified by:
deleteComment
in interfaceNewsfeedDetailsView
- Parameters:
commentId
- id of comment
-
showErrorDialog
public void showErrorDialog(java.lang.String error)
Description copied from interface:NewsfeedDetailsView
Notifies the view to show a dialog with the provided error message- Specified by:
showErrorDialog
in interfaceNewsfeedDetailsView
- Parameters:
error
- error message
-
deletePost
public void deletePost()
Description copied from interface:NewsfeedDetailsView
Notifies the view to delete the Post. Deleting the post also deletes the comments associated to it. This also means that the delete Post API was successful- Specified by:
deletePost
in interfaceNewsfeedDetailsView
-
updateComment
public void updateComment(SingleComment comment)
Description copied from interface:NewsfeedDetailsView
Notifies the view to update a comment from the existing list. This also means that the GET comment API with clearing of response cache was successful- Specified by:
updateComment
in interfaceNewsfeedDetailsView
- Parameters:
comment
- updatedSingleComment
-
onFacebookShareSuccess
public void onFacebookShareSuccess(com.facebook.share.Sharer.Result result)
- Specified by:
onFacebookShareSuccess
in interfaceFacebookHelper.FacebookShareCallBack
-
onFacebookShareCancelled
public void onFacebookShareCancelled()
- Specified by:
onFacebookShareCancelled
in interfaceFacebookHelper.FacebookShareCallBack
-
onFacebookShareError
public void onFacebookShareError(com.facebook.FacebookException e)
- Specified by:
onFacebookShareError
in interfaceFacebookHelper.FacebookShareCallBack
-
onDeleteComment
public void onDeleteComment(int commentId)
Description copied from interface:CommentClickListener
Method to handle deleting of comment- Specified by:
onDeleteComment
in interfaceCommentClickListener
- Parameters:
commentId
- id of comment
-
onLikeComment
public void onLikeComment(int postId, boolean isAttemptToLike, int commentId)
Description copied from interface:CommentClickListener
Method to handle the liking/unliking of comment- Specified by:
onLikeComment
in interfaceCommentClickListener
- Parameters:
postId
- id of the post the comment is associated toisAttemptToLike
- status if comment is liked/unlikedcommentId
- id of comment
-
onFlagComment
public void onFlagComment(int postId, int commentId, java.lang.String flag)
Description copied from interface:CommentClickListener
Method to handle the flagging/unflagging of comment- Specified by:
onFlagComment
in interfaceCommentClickListener
- Parameters:
postId
- id of the current postcommentId
- id of commentflag
- selected flag (e.g. spam)
-
onCommentLaunchProfile
public void onCommentLaunchProfile(Commenter commenter)
Description copied from interface:CommentClickListener
Method to handle launching of the Commenter's Profile- Specified by:
onCommentLaunchProfile
in interfaceCommentClickListener
- Parameters:
commenter
- profile of the member that added the comment
-
onDeletePost
public void onDeletePost()
Description copied from interface:PostDetailsClickListener
Method to handle deleting of post- Specified by:
onDeletePost
in interfacePostDetailsClickListener
-
onLikePost
public void onLikePost(boolean isAttempToLike)
Description copied from interface:PostDetailsClickListener
Method to handle liking of Post- Specified by:
onLikePost
in interfacePostDetailsClickListener
- Parameters:
isAttempToLike
- status if post is liked/unliked
-
onCommentClick
public void onCommentClick(Post post)
Description copied from interface:PostDetailsClickListener
Method to handle clicking of comment view- Specified by:
onCommentClick
in interfacePostDetailsClickListener
- Parameters:
post
-Post
-
onFlagNews
public void onFlagNews(int postId, java.lang.String flag)
Description copied from interface:PostDetailsClickListener
Method to handle clicking of flag view- Specified by:
onFlagNews
in interfacePostDetailsClickListener
- Parameters:
postId
- id of postflag
- key attribute of the selected flag fromFlag
-
onViewUrl
public void onViewUrl(android.net.Uri uri)
Description copied from interface:PostDetailsClickListener
Method to handle viewing of url- Specified by:
onViewUrl
in interfacePostDetailsClickListener
- Parameters:
uri
- uri to view
-
onShareUrl
public void onShareUrl(android.net.Uri uri)
Description copied from interface:PostDetailsClickListener
Method to handle sharing of url- Specified by:
onShareUrl
in interfacePostDetailsClickListener
- Parameters:
uri
- uri for sharing
-
onNewsLaunchProfile
public void onNewsLaunchProfile(Owner owner)
Description copied from interface:PostDetailsClickListener
Method to handle launching of Owner's profile- Specified by:
onNewsLaunchProfile
in interfacePostDetailsClickListener
- Parameters:
owner
-Owner
-
onLinkPreviewClick
public void onLinkPreviewClick(Post post)
Description copied from interface:PostDetailsClickListener
Method to handle clicking of link preview- Specified by:
onLinkPreviewClick
in interfacePostDetailsClickListener
- Parameters:
post
-Post
-
updatePost
public void updatePost(Post post)
Description copied from interface:NewsfeedDetailsView
Notifies the view to update the Post. This also means that the GET post API with clearing of cache was successful- Specified by:
updatePost
in interfaceNewsfeedDetailsView
- Parameters:
post
- updatedPost
-
revertPostChanges
public void revertPostChanges(java.lang.String error)
Description copied from interface:NewsfeedDetailsView
Notifies the view to revert any changes made to the post. This also means that Like/Unlike and Flag/Unflag of Post API failed- Specified by:
revertPostChanges
in interfaceNewsfeedDetailsView
- Parameters:
error
- error message
-
revertCommentChanges
public void revertCommentChanges(java.lang.String error, int commentId)
Description copied from interface:NewsfeedDetailsView
Notifies the view to revert any changes made to the comment associated to the post. This also means that Like/Unlike and Flag/Unflag of a comment failed- Specified by:
revertCommentChanges
in interfaceNewsfeedDetailsView
- Parameters:
error
- error messagecommentId
- id of the comment to revert
-
setSendCommentButtonClickListener
protected void setSendCommentButtonClickListener(android.view.View.OnClickListener listener)
Set click listener of send comment button (R.id.button_send_comment)- Parameters:
listener
- callback for comment button click
-
setCommentEditTextWatcher
protected void setCommentEditTextWatcher(android.text.TextWatcher textWatcher)
Set text watcher of comment edit text (R.id.edit_text_comment)- Parameters:
textWatcher
- instance ofTextWatcher
used in comment section
-
hideRefreshProgress
public void hideRefreshProgress()
Description copied from interface:NewsfeedDetailsView
Notifies the view to hide refresh progress. This also means that add comment API failed- Specified by:
hideRefreshProgress
in interfaceNewsfeedDetailsView
-
clearCommentEditText
public void clearCommentEditText()
Description copied from interface:NewsfeedDetailsView
Notifies the view to clear the content of Comment Edit Text. This also means that add comment API was successful- Specified by:
clearCommentEditText
in interfaceNewsfeedDetailsView
-
createAdapter
protected NewsfeedDetailsAdapter createAdapter()
Create the adapter used in current RecycleView present. This is commonly used when overriding theNewsfeedDetailsAdapter
- Returns:
- instance of
NewsfeedDetailsAdapter
-
createItemDecoration
protected androidx.recyclerview.widget.RecyclerView.ItemDecoration createItemDecoration()
Create the item decoration used in the RecyclerView. This invoked when initializing the list for the first time- Returns:
- instance of
RecyclerView.ItemDecoration
for the RecyclerView
-
-