@@ -30,10 +30,13 @@ public class OpenChannelListActivity extends AppCompatActivity {
30
30
* @param channelUrl the url of the channel will be implemented.
31
31
* @return OpenChannelListActivity Intent.
32
32
* since 3.2.0
33
+ * @deprecated 3.22.2
34
+ * <p> Use {@link OpenChannelListActivity#newIntent(Context)} instead.</p>
33
35
*/
36
+ @ Deprecated
34
37
@ NonNull
35
38
public static Intent newIntent (@ NonNull Context context , @ NonNull String channelUrl ) {
36
- return newIntentFromCustomActivity (context , OpenChannelListActivity .class , channelUrl );
39
+ return newIntentFromCustomActivity (context , OpenChannelListActivity .class );
37
40
}
38
41
39
42
/**
@@ -44,10 +47,13 @@ public static Intent newIntent(@NonNull Context context, @NonNull String channel
44
47
* @param themeResId the resource identifier for custom theme.
45
48
* @return OpenChannelListActivity Intent.
46
49
* since 3.5.6
50
+ * @deprecated 3.22.2
51
+ * <p> Use {@link OpenChannelListActivity#newIntent(Context, int)} instead.</p>
47
52
*/
53
+ @ Deprecated
48
54
@ NonNull
49
55
public static Intent newIntent (@ NonNull Context context , @ NonNull String channelUrl , @ StyleRes int themeResId ) {
50
- return newIntentFromCustomActivity (context , OpenChannelListActivity .class , channelUrl , themeResId );
56
+ return newIntentFromCustomActivity (context , OpenChannelListActivity .class , themeResId );
51
57
}
52
58
53
59
/**
@@ -58,10 +64,13 @@ public static Intent newIntent(@NonNull Context context, @NonNull String channel
58
64
* @param channelUrl the url of the channel will be implemented.
59
65
* @return Returns a newly created Intent that can be used to launch the activity.
60
66
* since 3.2.0
67
+ * @deprecated 3.22.2
68
+ * <p> Use {@link OpenChannelListActivity#newIntentFromCustomActivity(Context, Class)} instead.</p>
61
69
*/
70
+ @ Deprecated
62
71
@ NonNull
63
72
public static Intent newIntentFromCustomActivity (@ NonNull Context context , @ NonNull Class <? extends OpenChannelListActivity > cls , @ NonNull String channelUrl ) {
64
- return newIntentFromCustomActivity (context , cls , channelUrl , SendbirdUIKit .getDefaultThemeMode ().getResId ());
73
+ return newIntentFromCustomActivity (context , cls , SendbirdUIKit .getDefaultThemeMode ().getResId ());
65
74
}
66
75
67
76
/**
@@ -73,11 +82,65 @@ public static Intent newIntentFromCustomActivity(@NonNull Context context, @NonN
73
82
* @param themeResId the resource identifier for custom theme.
74
83
* @return Returns a newly created Intent that can be used to launch the activity.
75
84
* since 3.5.6
85
+ * @deprecated 3.22.2
86
+ * <p> Use {@link OpenChannelListActivity#newIntentFromCustomActivity(Context, Class, int)} instead.</p>
76
87
*/
88
+ @ Deprecated
77
89
@ NonNull
78
90
public static Intent newIntentFromCustomActivity (@ NonNull Context context , @ NonNull Class <? extends OpenChannelListActivity > cls , @ NonNull String channelUrl , @ StyleRes int themeResId ) {
91
+ return newIntentFromCustomActivity (context , cls , themeResId );
92
+ }
93
+
94
+ /**
95
+ * Create an intent for a {@link OpenChannelListActivity}.
96
+ *
97
+ * @param context A Context of the application package implementing this class.
98
+ * @return OpenChannelListActivity Intent.
99
+ * since 3.22.2
100
+ */
101
+ @ NonNull
102
+ public static Intent newIntent (@ NonNull Context context ) {
103
+ return newIntentFromCustomActivity (context , OpenChannelListActivity .class );
104
+ }
105
+
106
+ /**
107
+ * Create an intent for a {@link OpenChannelListActivity}.
108
+ *
109
+ * @param context A Context of the application package implementing this class.
110
+ * @param themeResId the resource identifier for custom theme.
111
+ * @return OpenChannelListActivity Intent.
112
+ * since 3.22.2
113
+ */
114
+ @ NonNull
115
+ public static Intent newIntent (@ NonNull Context context , @ StyleRes int themeResId ) {
116
+ return newIntentFromCustomActivity (context , OpenChannelListActivity .class , themeResId );
117
+ }
118
+
119
+ /**
120
+ * Create an intent for a custom activity. The custom activity must inherit {@link OpenChannelListActivity}.
121
+ *
122
+ * @param context A Context of the application package implementing this class.
123
+ * @param cls The activity class that is to be used for the intent.
124
+ * @return Returns a newly created Intent that can be used to launch the activity.
125
+ * since 3.22.2
126
+ */
127
+ @ NonNull
128
+ public static Intent newIntentFromCustomActivity (@ NonNull Context context , @ NonNull Class <? extends OpenChannelListActivity > cls ) {
129
+ return newIntentFromCustomActivity (context , cls , SendbirdUIKit .getDefaultThemeMode ().getResId ());
130
+ }
131
+
132
+ /**
133
+ * Create an intent for a custom activity. The custom activity must inherit {@link OpenChannelListActivity}.
134
+ *
135
+ * @param context A Context of the application package implementing this class.
136
+ * @param cls The activity class that is to be used for the intent.
137
+ * @param themeResId the resource identifier for custom theme.
138
+ * @return Returns a newly created Intent that can be used to launch the activity.
139
+ * since 3.22.2
140
+ */
141
+ @ NonNull
142
+ public static Intent newIntentFromCustomActivity (@ NonNull Context context , @ NonNull Class <? extends OpenChannelListActivity > cls , @ StyleRes int themeResId ) {
79
143
Intent intent = new Intent (context , cls );
80
- intent .putExtra (StringSet .KEY_CHANNEL_URL , channelUrl );
81
144
intent .putExtra (StringSet .KEY_THEME_RES_ID , themeResId );
82
145
return intent ;
83
146
}
@@ -89,17 +152,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
89
152
setTheme (themeResId );
90
153
setContentView (R .layout .sb_activity );
91
154
92
- String url = getIntent ().getStringExtra (StringSet .KEY_CHANNEL_URL );
93
- if (TextUtils .isEmpty (url )) {
94
- ContextUtils .toastError (this , R .string .sb_text_error_get_channel );
95
- } else {
96
- Fragment fragment = createFragment ();
97
- FragmentManager manager = getSupportFragmentManager ();
98
- manager .popBackStack ();
99
- manager .beginTransaction ()
100
- .replace (R .id .sb_fragment_container , fragment )
101
- .commit ();
102
- }
155
+ Fragment fragment = createFragment ();
156
+ FragmentManager manager = getSupportFragmentManager ();
157
+ manager .popBackStack ();
158
+ manager .beginTransaction ()
159
+ .replace (R .id .sb_fragment_container , fragment )
160
+ .commit ();
103
161
}
104
162
105
163
/**
0 commit comments