kopia lustrzana https://github.com/ryukoposting/Signal-Android
Remove ViewUtil deprecated methods.
rodzic
744b79419b
commit
73afa82147
|
@ -32,9 +32,9 @@ public class DeviceAddFragment extends LoggingFragment {
|
|||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
this.container = ViewUtil.inflate(inflater, viewGroup, R.layout.device_add_fragment);
|
||||
this.overlay = ViewUtil.findById(this.container, R.id.overlay);
|
||||
this.scannerView = ViewUtil.findById(this.container, R.id.scanner);
|
||||
this.devicesImage = ViewUtil.findById(this.container, R.id.devices);
|
||||
this.overlay = this.container.findViewById(R.id.overlay);
|
||||
this.scannerView = this.container.findViewById(R.id.scanner);
|
||||
this.devicesImage = this.container.findViewById(R.id.devices);
|
||||
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
this.overlay.setOrientation(LinearLayout.HORIZONTAL);
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.thoughtcrime.securesms.database.loaders.DeviceListLoader;
|
|||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.devicelist.Device;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.task.ProgressDialogAsyncTask;
|
||||
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
||||
|
||||
|
@ -68,7 +67,7 @@ public class DeviceListFragment extends ListFragment
|
|||
|
||||
this.empty = view.findViewById(R.id.empty);
|
||||
this.progressContainer = view.findViewById(R.id.progress_container);
|
||||
this.addDeviceButton = ViewUtil.findById(view, R.id.add_device);
|
||||
this.addDeviceButton = view.findViewById(R.id.add_device);
|
||||
this.addDeviceButton.setOnClickListener(this);
|
||||
|
||||
return view;
|
||||
|
|
|
@ -93,14 +93,14 @@ public class InviteActivity extends PassphraseRequiredActivity implements Contac
|
|||
slideInAnimation = loadAnimation(R.anim.slide_from_bottom);
|
||||
slideOutAnimation = loadAnimation(R.anim.slide_to_bottom);
|
||||
|
||||
View shareButton = ViewUtil.findById(this, R.id.share_button);
|
||||
View smsButton = ViewUtil.findById(this, R.id.sms_button);
|
||||
Button smsCancelButton = ViewUtil.findById(this, R.id.cancel_sms_button);
|
||||
ContactFilterToolbar contactFilter = ViewUtil.findById(this, R.id.contact_filter);
|
||||
View shareButton = findViewById(R.id.share_button);
|
||||
View smsButton = findViewById(R.id.sms_button);
|
||||
Button smsCancelButton = findViewById(R.id.cancel_sms_button);
|
||||
ContactFilterToolbar contactFilter = findViewById(R.id.contact_filter);
|
||||
|
||||
inviteText = ViewUtil.findById(this, R.id.invite_text);
|
||||
smsSendFrame = ViewUtil.findById(this, R.id.sms_send_frame);
|
||||
smsSendButton = ViewUtil.findById(this, R.id.send_sms_button);
|
||||
inviteText = findViewById(R.id.invite_text);
|
||||
smsSendFrame = findViewById(R.id.sms_send_frame);
|
||||
smsSendButton = findViewById(R.id.send_sms_button);
|
||||
contactsFragment = (ContactSelectionListFragment)getSupportFragmentManager().findFragmentById(R.id.contact_selection_list_fragment);
|
||||
|
||||
inviteText.setText(getString(R.string.InviteActivity_lets_switch_to_signal, getString(R.string.install_url)));
|
||||
|
|
|
@ -11,8 +11,6 @@ import android.widget.TextView;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TransportOptionsAdapter extends BaseAdapter {
|
||||
|
@ -55,9 +53,9 @@ public class TransportOptionsAdapter extends BaseAdapter {
|
|||
}
|
||||
|
||||
TransportOption transport = (TransportOption) getItem(position);
|
||||
ImageView imageView = ViewUtil.findById(convertView, R.id.icon);
|
||||
TextView textView = ViewUtil.findById(convertView, R.id.text);
|
||||
TextView subtextView = ViewUtil.findById(convertView, R.id.subtext);
|
||||
ImageView imageView = convertView.findViewById(R.id.icon);
|
||||
TextView textView = convertView.findViewById(R.id.text);
|
||||
TextView subtextView = convertView.findViewById(R.id.subtext);
|
||||
|
||||
imageView.getBackground().setColorFilter(transport.getBackgroundColor(), Mode.MULTIPLY);
|
||||
imageView.setImageResource(transport.getDrawable());
|
||||
|
|
|
@ -258,24 +258,24 @@ public class VerifyIdentityActivity extends PassphraseRequiredActivity implement
|
|||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
this.container = ViewUtil.inflate(inflater, viewGroup, R.layout.verify_display_fragment);
|
||||
this.numbersContainer = ViewUtil.findById(container, R.id.number_table);
|
||||
this.qrCode = ViewUtil.findById(container, R.id.qr_code);
|
||||
this.verified = ViewUtil.findById(container, R.id.verified_switch);
|
||||
this.qrVerified = ViewUtil.findById(container, R.id.qr_verified);
|
||||
this.description = ViewUtil.findById(container, R.id.description);
|
||||
this.tapLabel = ViewUtil.findById(container, R.id.tap_label);
|
||||
this.codes[0] = ViewUtil.findById(container, R.id.code_first);
|
||||
this.codes[1] = ViewUtil.findById(container, R.id.code_second);
|
||||
this.codes[2] = ViewUtil.findById(container, R.id.code_third);
|
||||
this.codes[3] = ViewUtil.findById(container, R.id.code_fourth);
|
||||
this.codes[4] = ViewUtil.findById(container, R.id.code_fifth);
|
||||
this.codes[5] = ViewUtil.findById(container, R.id.code_sixth);
|
||||
this.codes[6] = ViewUtil.findById(container, R.id.code_seventh);
|
||||
this.codes[7] = ViewUtil.findById(container, R.id.code_eighth);
|
||||
this.codes[8] = ViewUtil.findById(container, R.id.code_ninth);
|
||||
this.codes[9] = ViewUtil.findById(container, R.id.code_tenth);
|
||||
this.codes[10] = ViewUtil.findById(container, R.id.code_eleventh);
|
||||
this.codes[11] = ViewUtil.findById(container, R.id.code_twelth);
|
||||
this.numbersContainer = container.findViewById(R.id.number_table);
|
||||
this.qrCode = container.findViewById(R.id.qr_code);
|
||||
this.verified = container.findViewById(R.id.verified_switch);
|
||||
this.qrVerified = container.findViewById(R.id.qr_verified);
|
||||
this.description = container.findViewById(R.id.description);
|
||||
this.tapLabel = container.findViewById(R.id.tap_label);
|
||||
this.codes[0] = container.findViewById(R.id.code_first);
|
||||
this.codes[1] = container.findViewById(R.id.code_second);
|
||||
this.codes[2] = container.findViewById(R.id.code_third);
|
||||
this.codes[3] = container.findViewById(R.id.code_fourth);
|
||||
this.codes[4] = container.findViewById(R.id.code_fifth);
|
||||
this.codes[5] = container.findViewById(R.id.code_sixth);
|
||||
this.codes[6] = container.findViewById(R.id.code_seventh);
|
||||
this.codes[7] = container.findViewById(R.id.code_eighth);
|
||||
this.codes[8] = container.findViewById(R.id.code_ninth);
|
||||
this.codes[9] = container.findViewById(R.id.code_tenth);
|
||||
this.codes[10] = container.findViewById(R.id.code_eleventh);
|
||||
this.codes[11] = container.findViewById(R.id.code_twelth);
|
||||
|
||||
this.qrCode.setOnClickListener(clickListener);
|
||||
this.registerForContextMenu(numbersContainer);
|
||||
|
@ -664,7 +664,7 @@ public class VerifyIdentityActivity extends PassphraseRequiredActivity implement
|
|||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
this.container = ViewUtil.inflate(inflater, viewGroup, R.layout.verify_scan_fragment);
|
||||
this.cameraView = ViewUtil.findById(container, R.id.scanner);
|
||||
this.cameraView = container.findViewById(R.id.scanner);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import androidx.core.view.ViewCompat;
|
|||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
public final class MicrophoneRecorderView extends FrameLayout implements View.OnTouchListener {
|
||||
|
||||
|
@ -55,7 +54,7 @@ public final class MicrophoneRecorderView extends FrameLayout implements View.On
|
|||
floatingRecordButton = new FloatingRecordButton(getContext(), findViewById(R.id.quick_audio_fab));
|
||||
lockDropTarget = new LockDropTarget (getContext(), findViewById(R.id.lock_drop_target));
|
||||
|
||||
View recordButton = ViewUtil.findById(this, R.id.quick_audio_toggle);
|
||||
View recordButton = findViewById(R.id.quick_audio_toggle);
|
||||
recordButton.setOnTouchListener(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.thoughtcrime.securesms.R;
|
|||
import org.thoughtcrime.securesms.database.CursorRecyclerViewAdapter;
|
||||
import org.thoughtcrime.securesms.database.loaders.RecentPhotosLoader;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
public class RecentPhotoViewRail extends FrameLayout implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||
|
||||
|
@ -52,7 +51,7 @@ public class RecentPhotoViewRail extends FrameLayout implements LoaderManager.Lo
|
|||
|
||||
inflate(context, R.layout.recent_photo_view, this);
|
||||
|
||||
this.recyclerView = ViewUtil.findById(this, R.id.photo_list);
|
||||
this.recyclerView = findViewById(R.id.photo_list);
|
||||
this.recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
|
||||
this.recyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||
}
|
||||
|
@ -158,7 +157,7 @@ public class RecentPhotoViewRail extends FrameLayout implements LoaderManager.Lo
|
|||
RecentPhotoViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
this.imageView = ViewUtil.findById(itemView, R.id.thumbnail);
|
||||
this.imageView = itemView.findViewById(R.id.thumbnail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
public final class RecyclerViewFastScroller extends LinearLayout {
|
||||
private static final int BUBBLE_ANIMATION_DURATION = 100;
|
||||
|
@ -75,8 +74,8 @@ public final class RecyclerViewFastScroller extends LinearLayout {
|
|||
setClipChildren(false);
|
||||
setScrollContainer(true);
|
||||
inflate(context, R.layout.recycler_view_fast_scroller, this);
|
||||
bubble = ViewUtil.findById(this, R.id.fastscroller_bubble);
|
||||
handle = ViewUtil.findById(this, R.id.fastscroller_handle);
|
||||
bubble = findViewById(R.id.fastscroller_bubble);
|
||||
handle = findViewById(R.id.fastscroller_handle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.thoughtcrime.securesms.database.MediaDatabase;
|
|||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.mms.Slide;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
public class ThreadPhotoRailView extends FrameLayout {
|
||||
|
||||
|
@ -41,7 +40,7 @@ public class ThreadPhotoRailView extends FrameLayout {
|
|||
|
||||
inflate(context, R.layout.recipient_preference_photo_rail, this);
|
||||
|
||||
this.recyclerView = ViewUtil.findById(this, R.id.photo_list);
|
||||
this.recyclerView = findViewById(R.id.photo_list);
|
||||
this.recyclerView.setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
|
||||
this.recyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||
this.recyclerView.setNestedScrollingEnabled(false);
|
||||
|
@ -112,7 +111,7 @@ public class ThreadPhotoRailView extends FrameLayout {
|
|||
ThreadPhotoViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
this.imageView = ViewUtil.findById(itemView, R.id.thumbnail);
|
||||
this.imageView = itemView.findViewById(R.id.thumbnail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.thoughtcrime.securesms.attachments.Attachment;
|
|||
import org.thoughtcrime.securesms.database.AttachmentDatabase;
|
||||
import org.thoughtcrime.securesms.events.PartProgressEvent;
|
||||
import org.thoughtcrime.securesms.mms.Slide;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -61,16 +60,16 @@ public final class TransferControlView extends FrameLayout {
|
|||
inflate(context, R.layout.transfer_controls_view, this);
|
||||
|
||||
setLongClickable(false);
|
||||
ViewUtil.setBackground(this, ContextCompat.getDrawable(context, R.drawable.transfer_controls_background));
|
||||
setBackground(ContextCompat.getDrawable(context, R.drawable.transfer_controls_background));
|
||||
setVisibility(GONE);
|
||||
setLayoutTransition(new LayoutTransition());
|
||||
|
||||
this.networkProgress = new HashMap<>();
|
||||
this.compresssionProgress = new HashMap<>();
|
||||
|
||||
this.progressWheel = ViewUtil.findById(this, R.id.progress_wheel);
|
||||
this.downloadDetails = ViewUtil.findById(this, R.id.download_details);
|
||||
this.downloadDetailsText = ViewUtil.findById(this, R.id.download_details_text);
|
||||
this.progressWheel = findViewById(R.id.progress_wheel);
|
||||
this.downloadDetails = findViewById(R.id.download_details);
|
||||
this.downloadDetailsText = findViewById(R.id.download_details_text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,7 +17,6 @@ import androidx.annotation.RequiresApi;
|
|||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.database.IdentityDatabase.IdentityRecord;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -53,9 +52,9 @@ public class UnverifiedBannerView extends LinearLayout {
|
|||
|
||||
private void initialize() {
|
||||
LayoutInflater.from(getContext()).inflate(R.layout.unverified_banner_view, this, true);
|
||||
this.container = ViewUtil.findById(this, R.id.container);
|
||||
this.text = ViewUtil.findById(this, R.id.unverified_text);
|
||||
this.closeButton = ViewUtil.findById(this, R.id.cancel);
|
||||
this.container = findViewById(R.id.container);
|
||||
this.text = findViewById(R.id.unverified_text);
|
||||
this.closeButton = findViewById(R.id.cancel);
|
||||
}
|
||||
|
||||
public void display(@NonNull final String text,
|
||||
|
|
|
@ -18,7 +18,6 @@ import com.google.android.gms.maps.OnMapReadyCallback;
|
|||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SettableFuture;
|
||||
|
||||
|
@ -47,9 +46,9 @@ public class SignalMapView extends LinearLayout {
|
|||
setOrientation(LinearLayout.VERTICAL);
|
||||
LayoutInflater.from(context).inflate(R.layout.signal_map_view, this, true);
|
||||
|
||||
this.mapView = ViewUtil.findById(this, R.id.map_view);
|
||||
this.imageView = ViewUtil.findById(this, R.id.image_view);
|
||||
this.textView = ViewUtil.findById(this, R.id.address_view);
|
||||
this.mapView = findViewById(R.id.map_view);
|
||||
this.imageView = findViewById(R.id.image_view);
|
||||
this.textView = findViewById(R.id.address_view);
|
||||
}
|
||||
|
||||
public ListenableFuture<Bitmap> display(final SignalPlace place) {
|
||||
|
|
|
@ -1882,31 +1882,31 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
|||
|
||||
private void initializeViews() {
|
||||
titleView = findViewById(R.id.conversation_title_view);
|
||||
buttonToggle = ViewUtil.findById(this, R.id.button_toggle);
|
||||
sendButton = ViewUtil.findById(this, R.id.send_button);
|
||||
attachButton = ViewUtil.findById(this, R.id.attach_button);
|
||||
composeText = ViewUtil.findById(this, R.id.embedded_text_editor);
|
||||
charactersLeft = ViewUtil.findById(this, R.id.space_left);
|
||||
buttonToggle = findViewById(R.id.button_toggle);
|
||||
sendButton = findViewById(R.id.send_button);
|
||||
attachButton = findViewById(R.id.attach_button);
|
||||
composeText = findViewById(R.id.embedded_text_editor);
|
||||
charactersLeft = findViewById(R.id.space_left);
|
||||
emojiDrawerStub = ViewUtil.findStubById(this, R.id.emoji_drawer_stub);
|
||||
attachmentKeyboardStub = ViewUtil.findStubById(this, R.id.attachment_keyboard_stub);
|
||||
unblockButton = ViewUtil.findById(this, R.id.unblock_button);
|
||||
makeDefaultSmsButton = ViewUtil.findById(this, R.id.make_default_sms_button);
|
||||
registerButton = ViewUtil.findById(this, R.id.register_button);
|
||||
container = ViewUtil.findById(this, R.id.layout_container);
|
||||
unblockButton = findViewById(R.id.unblock_button);
|
||||
makeDefaultSmsButton = findViewById(R.id.make_default_sms_button);
|
||||
registerButton = findViewById(R.id.register_button);
|
||||
container = findViewById(R.id.layout_container);
|
||||
reminderView = ViewUtil.findStubById(this, R.id.reminder_stub);
|
||||
unverifiedBannerView = ViewUtil.findStubById(this, R.id.unverified_banner_stub);
|
||||
reviewBanner = ViewUtil.findStubById(this, R.id.review_banner_stub);
|
||||
quickAttachmentToggle = ViewUtil.findById(this, R.id.quick_attachment_toggle);
|
||||
inlineAttachmentToggle = ViewUtil.findById(this, R.id.inline_attachment_container);
|
||||
inputPanel = ViewUtil.findById(this, R.id.bottom_panel);
|
||||
panelParent = ViewUtil.findById(this, R.id.conversation_activity_panel_parent);
|
||||
searchNav = ViewUtil.findById(this, R.id.conversation_search_nav);
|
||||
messageRequestBottomView = ViewUtil.findById(this, R.id.conversation_activity_message_request_bottom_bar);
|
||||
reactionOverlay = ViewUtil.findById(this, R.id.conversation_reaction_scrubber);
|
||||
quickAttachmentToggle = findViewById(R.id.quick_attachment_toggle);
|
||||
inlineAttachmentToggle = findViewById(R.id.inline_attachment_container);
|
||||
inputPanel = findViewById(R.id.bottom_panel);
|
||||
panelParent = findViewById(R.id.conversation_activity_panel_parent);
|
||||
searchNav = findViewById(R.id.conversation_search_nav);
|
||||
messageRequestBottomView = findViewById(R.id.conversation_activity_message_request_bottom_bar);
|
||||
reactionOverlay = findViewById(R.id.conversation_reaction_scrubber);
|
||||
mentionsSuggestions = ViewUtil.findStubById(this, R.id.conversation_mention_suggestions_stub);
|
||||
|
||||
ImageButton quickCameraToggle = ViewUtil.findById(this, R.id.quick_camera_toggle);
|
||||
ImageButton inlineAttachmentButton = ViewUtil.findById(this, R.id.inline_attachment_button);
|
||||
ImageButton quickCameraToggle = findViewById(R.id.quick_camera_toggle);
|
||||
ImageButton inlineAttachmentButton = findViewById(R.id.inline_attachment_button);
|
||||
|
||||
noLongerMemberBanner = findViewById(R.id.conversation_no_longer_member_banner);
|
||||
requestingMemberBanner = findViewById(R.id.conversation_requesting_banner);
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.thoughtcrime.securesms.BindableConversationListItem;
|
|||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.database.model.ThreadRecord;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
@ -38,7 +37,7 @@ public class ConversationListItemAction extends LinearLayout implements Bindable
|
|||
@Override
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
this.description = ViewUtil.findById(this, R.id.description);
|
||||
this.description = findViewById(R.id.description);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.thoughtcrime.securesms.util.DynamicDarkToolbarTheme;
|
|||
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
||||
import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.WindowUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -74,7 +73,7 @@ public class GiphyActivity extends PassphraseRequiredActivity
|
|||
|
||||
private void initializeToolbar() {
|
||||
|
||||
GiphyActivityToolbar toolbar = ViewUtil.findById(this, R.id.giphy_toolbar);
|
||||
GiphyActivityToolbar toolbar = findViewById(R.id.giphy_toolbar);
|
||||
toolbar.setOnFilterChangedListener(this);
|
||||
toolbar.setOnLayoutChangedListener(this);
|
||||
toolbar.setPersistence(GiphyActivityToolbarTextSecurePreferencesPersistence.fromContext(this));
|
||||
|
@ -90,8 +89,8 @@ public class GiphyActivity extends PassphraseRequiredActivity
|
|||
}
|
||||
|
||||
private void initializeResources() {
|
||||
ViewPager viewPager = ViewUtil.findById(this, R.id.giphy_pager);
|
||||
TabLayout tabLayout = ViewUtil.findById(this, R.id.tab_layout);
|
||||
ViewPager viewPager = findViewById(R.id.giphy_pager);
|
||||
TabLayout tabLayout = findViewById(R.id.tab_layout);
|
||||
|
||||
this.gifFragment = new GiphyGifFragment();
|
||||
this.stickerFragment = new GiphyStickerFragment();
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.thoughtcrime.securesms.giph.model.GiphyImage;
|
|||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
@ -56,8 +55,8 @@ class GiphyAdapter extends RecyclerView.Adapter<GiphyAdapter.GiphyViewHolder> {
|
|||
|
||||
GiphyViewHolder(View view) {
|
||||
super(view);
|
||||
thumbnail = ViewUtil.findById(view, R.id.thumbnail);
|
||||
gifProgress = ViewUtil.findById(view, R.id.gif_progress);
|
||||
thumbnail = view.findViewById(R.id.thumbnail);
|
||||
gifProgress = view.findViewById(R.id.gif_progress);
|
||||
thumbnail.setOnClickListener(this);
|
||||
gifProgress.setVisibility(View.GONE);
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ public abstract class GiphyFragment extends LoggingFragment implements LoaderMan
|
|||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
ViewGroup container = ViewUtil.inflate(inflater, viewGroup, R.layout.giphy_fragment);
|
||||
this.recyclerView = ViewUtil.findById(container, R.id.giphy_list);
|
||||
this.loadingProgress = ViewUtil.findById(container, R.id.loading_progress);
|
||||
this.noResultsView = ViewUtil.findById(container, R.id.no_results);
|
||||
this.recyclerView = container.findViewById(R.id.giphy_list);
|
||||
this.loadingProgress = container.findViewById(R.id.loading_progress);
|
||||
this.noResultsView = container.findViewById(R.id.no_results);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
|
|
@ -104,11 +104,11 @@ public class AttachmentManager {
|
|||
if (!attachmentViewStub.resolved()) {
|
||||
View root = attachmentViewStub.get();
|
||||
|
||||
this.thumbnail = ViewUtil.findById(root, R.id.attachment_thumbnail);
|
||||
this.audioView = ViewUtil.findById(root, R.id.attachment_audio);
|
||||
this.documentView = ViewUtil.findById(root, R.id.attachment_document);
|
||||
this.mapView = ViewUtil.findById(root, R.id.attachment_location);
|
||||
this.removableMediaView = ViewUtil.findById(root, R.id.removable_media_view);
|
||||
this.thumbnail = root.findViewById(R.id.attachment_thumbnail);
|
||||
this.audioView = root.findViewById(R.id.attachment_audio);
|
||||
this.documentView = root.findViewById(R.id.attachment_document);
|
||||
this.mapView = root.findViewById(R.id.attachment_location);
|
||||
this.removableMediaView = root.findViewById(R.id.removable_media_view);
|
||||
|
||||
removableMediaView.setRemoveClickListener(new RemoveButtonListener());
|
||||
thumbnail.setOnClickListener(new ThumbnailClickListener());
|
||||
|
|
|
@ -20,7 +20,6 @@ import android.annotation.SuppressLint;
|
|||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -78,31 +77,11 @@ public final class ViewUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static void setBackground(final @NonNull View v, final @Nullable Drawable drawable) {
|
||||
v.setBackground(drawable);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends View> T inflateStub(@NonNull View parent, @IdRes int stubId) {
|
||||
return (T)((ViewStub)parent.findViewById(stubId)).inflate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link View#findViewById} directly.
|
||||
*/
|
||||
@Deprecated
|
||||
public static <T extends View> T findById(@NonNull View parent, @IdRes int resId) {
|
||||
return parent.findViewById(resId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Activity#findViewById} directly.
|
||||
*/
|
||||
@Deprecated
|
||||
public static <T extends View> T findById(@NonNull Activity parent, @IdRes int resId) {
|
||||
return parent.findViewById(resId);
|
||||
}
|
||||
|
||||
public static <T extends View> Stub<T> findStubById(@NonNull Activity parent, @IdRes int resId) {
|
||||
return new Stub<>(parent.findViewById(resId));
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
|||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.mms.VideoSlide;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.video.exo.AttachmentDataSourceFactory;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -81,7 +80,7 @@ public class VideoPlayer extends FrameLayout {
|
|||
|
||||
inflate(context, R.layout.video_player, this);
|
||||
|
||||
this.exoView = ViewUtil.findById(this, R.id.video_view);
|
||||
this.exoView = findViewById(R.id.video_view);
|
||||
this.exoControls = new PlayerControlView(getContext());
|
||||
this.exoControls.setShowTimeoutMs(-1);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue