Initial commit
This commit is contained in:
81
sources/com/bottle/hp/album/BaseActivity.java
Normal file
81
sources/com/bottle/hp/album/BaseActivity.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
import android.R;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
private boolean a;
|
||||
private TextView b;
|
||||
|
||||
public boolean D0() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void b(int i, int i2) {
|
||||
a(getString(i), i2);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
try {
|
||||
this.a = getResources().getBoolean(R$bool.isTablet);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void a(final String str, final int i) {
|
||||
runOnUiThread(new Runnable() { // from class: com.bottle.hp.album.BaseActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (BaseActivity.this.b != null) {
|
||||
BaseActivity.this.a(str, i, BaseActivity.this.getResources());
|
||||
BaseActivity.this.b.setVisibility(0);
|
||||
return;
|
||||
}
|
||||
ViewGroup viewGroup = (ViewGroup) BaseActivity.this.findViewById(R.id.content);
|
||||
Resources resources = BaseActivity.this.getResources();
|
||||
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-1, -2);
|
||||
BaseActivity baseActivity = BaseActivity.this;
|
||||
baseActivity.b = new TextView(baseActivity);
|
||||
BaseActivity.this.a(str, i, resources);
|
||||
viewGroup.addView(BaseActivity.this.b, layoutParams);
|
||||
}
|
||||
});
|
||||
this.b.postDelayed(new Runnable() { // from class: com.bottle.hp.album.BaseActivity.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
BaseActivity.this.b.setVisibility(4);
|
||||
}
|
||||
}, 2000L);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(String str, int i, Resources resources) {
|
||||
this.b.setText(str);
|
||||
if (D0()) {
|
||||
this.b.setTextSize(20.0f);
|
||||
} else {
|
||||
this.b.setTextSize(12.0f);
|
||||
}
|
||||
this.b.setGravity(17);
|
||||
this.b.setTextColor(-1);
|
||||
if (i == 0) {
|
||||
this.b.setBackgroundColor(resources.getColor(R$color.snackbar_level_waiting));
|
||||
} else if (i == 1) {
|
||||
this.b.setBackgroundColor(resources.getColor(R$color.snackbar_level_success));
|
||||
} else {
|
||||
if (i != 2) {
|
||||
return;
|
||||
}
|
||||
this.b.setBackgroundColor(resources.getColor(R$color.snackbar_level_error));
|
||||
}
|
||||
}
|
||||
}
|
10
sources/com/bottle/hp/album/R$bool.java
Normal file
10
sources/com/bottle/hp/album/R$bool.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$bool {
|
||||
public static final int abc_action_bar_embed_tabs = 2131034112;
|
||||
public static final int abc_allow_stacked_button_bar = 2131034113;
|
||||
public static final int abc_config_actionMenuItemAllCaps = 2131034114;
|
||||
public static final int isTablet = 2131034115;
|
||||
public static final int mtrl_btn_textappearance_all_caps = 2131034116;
|
||||
}
|
226
sources/com/bottle/hp/album/R$color.java
Normal file
226
sources/com/bottle/hp/album/R$color.java
Normal file
@@ -0,0 +1,226 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$color {
|
||||
public static final int abc_background_cache_hint_selector_material_dark = 2131099648;
|
||||
public static final int abc_background_cache_hint_selector_material_light = 2131099649;
|
||||
public static final int abc_btn_colored_borderless_text_material = 2131099650;
|
||||
public static final int abc_btn_colored_text_material = 2131099651;
|
||||
public static final int abc_color_highlight_material = 2131099652;
|
||||
public static final int abc_hint_foreground_material_dark = 2131099653;
|
||||
public static final int abc_hint_foreground_material_light = 2131099654;
|
||||
public static final int abc_input_method_navigation_guard = 2131099655;
|
||||
public static final int abc_primary_text_disable_only_material_dark = 2131099656;
|
||||
public static final int abc_primary_text_disable_only_material_light = 2131099657;
|
||||
public static final int abc_primary_text_material_dark = 2131099658;
|
||||
public static final int abc_primary_text_material_light = 2131099659;
|
||||
public static final int abc_search_url_text = 2131099660;
|
||||
public static final int abc_search_url_text_normal = 2131099661;
|
||||
public static final int abc_search_url_text_pressed = 2131099662;
|
||||
public static final int abc_search_url_text_selected = 2131099663;
|
||||
public static final int abc_secondary_text_material_dark = 2131099664;
|
||||
public static final int abc_secondary_text_material_light = 2131099665;
|
||||
public static final int abc_tint_btn_checkable = 2131099666;
|
||||
public static final int abc_tint_default = 2131099667;
|
||||
public static final int abc_tint_edittext = 2131099668;
|
||||
public static final int abc_tint_seek_thumb = 2131099669;
|
||||
public static final int abc_tint_spinner = 2131099670;
|
||||
public static final int abc_tint_switch_track = 2131099671;
|
||||
public static final int accent_material_dark = 2131099672;
|
||||
public static final int accent_material_light = 2131099673;
|
||||
public static final int actionbar = 2131099674;
|
||||
public static final int background_floating_material_dark = 2131099675;
|
||||
public static final int background_floating_material_light = 2131099676;
|
||||
public static final int background_material_dark = 2131099677;
|
||||
public static final int background_material_light = 2131099678;
|
||||
public static final int bright_foreground_disabled_material_dark = 2131099745;
|
||||
public static final int bright_foreground_disabled_material_light = 2131099746;
|
||||
public static final int bright_foreground_inverse_material_dark = 2131099747;
|
||||
public static final int bright_foreground_inverse_material_light = 2131099748;
|
||||
public static final int bright_foreground_material_dark = 2131099749;
|
||||
public static final int bright_foreground_material_light = 2131099750;
|
||||
public static final int browser_actions_bg_grey = 2131099751;
|
||||
public static final int browser_actions_divider_color = 2131099752;
|
||||
public static final int browser_actions_text_color = 2131099753;
|
||||
public static final int browser_actions_title_color = 2131099754;
|
||||
public static final int button_material_dark = 2131099755;
|
||||
public static final int button_material_light = 2131099756;
|
||||
public static final int cardview_dark_background = 2131099757;
|
||||
public static final int cardview_light_background = 2131099758;
|
||||
public static final int cardview_shadow_end_color = 2131099759;
|
||||
public static final int cardview_shadow_start_color = 2131099760;
|
||||
public static final int colorAccent = 2131099761;
|
||||
public static final int colorBlack = 2131099763;
|
||||
public static final int colorCapture = 2131099764;
|
||||
public static final int colorItem = 2131099765;
|
||||
public static final int colorPrimary = 2131099766;
|
||||
public static final int colorPrimaryDark = 2131099767;
|
||||
public static final int com_facebook_blue = 2131099798;
|
||||
public static final int com_facebook_button_background_color = 2131099799;
|
||||
public static final int com_facebook_button_background_color_disabled = 2131099800;
|
||||
public static final int com_facebook_button_background_color_focused = 2131099801;
|
||||
public static final int com_facebook_button_background_color_focused_disabled = 2131099802;
|
||||
public static final int com_facebook_button_background_color_pressed = 2131099803;
|
||||
public static final int com_facebook_button_background_color_selected = 2131099804;
|
||||
public static final int com_facebook_button_border_color_focused = 2131099805;
|
||||
public static final int com_facebook_button_login_background_color = 2131099806;
|
||||
public static final int com_facebook_button_login_silver_background_color = 2131099807;
|
||||
public static final int com_facebook_button_login_silver_background_color_pressed = 2131099808;
|
||||
public static final int com_facebook_button_send_background_color = 2131099809;
|
||||
public static final int com_facebook_button_send_background_color_pressed = 2131099810;
|
||||
public static final int com_facebook_button_text_color = 2131099811;
|
||||
public static final int com_facebook_device_auth_text = 2131099812;
|
||||
public static final int com_facebook_likeboxcountview_border_color = 2131099813;
|
||||
public static final int com_facebook_likeboxcountview_text_color = 2131099814;
|
||||
public static final int com_facebook_likeview_text_color = 2131099815;
|
||||
public static final int com_facebook_messenger_blue = 2131099816;
|
||||
public static final int com_facebook_send_button_text_color = 2131099817;
|
||||
public static final int com_facebook_share_button_text_color = 2131099818;
|
||||
public static final int com_smart_login_code = 2131099819;
|
||||
public static final int comm_bg_24A8FF = 2131099820;
|
||||
public static final int comm_bg_596F80 = 2131099821;
|
||||
public static final int comm_bg_92A7B6 = 2131099822;
|
||||
public static final int comm_bg_white = 2131099823;
|
||||
public static final int comm_transparent = 2131099824;
|
||||
public static final int common_google_signin_btn_text_dark = 2131099825;
|
||||
public static final int common_google_signin_btn_text_dark_default = 2131099826;
|
||||
public static final int common_google_signin_btn_text_dark_disabled = 2131099827;
|
||||
public static final int common_google_signin_btn_text_dark_focused = 2131099828;
|
||||
public static final int common_google_signin_btn_text_dark_pressed = 2131099829;
|
||||
public static final int common_google_signin_btn_text_light = 2131099830;
|
||||
public static final int common_google_signin_btn_text_light_default = 2131099831;
|
||||
public static final int common_google_signin_btn_text_light_disabled = 2131099832;
|
||||
public static final int common_google_signin_btn_text_light_focused = 2131099833;
|
||||
public static final int common_google_signin_btn_text_light_pressed = 2131099834;
|
||||
public static final int common_google_signin_btn_tint = 2131099835;
|
||||
public static final int design_bottom_navigation_shadow_color = 2131099838;
|
||||
public static final int design_default_color_primary = 2131099839;
|
||||
public static final int design_default_color_primary_dark = 2131099840;
|
||||
public static final int design_error = 2131099841;
|
||||
public static final int design_fab_shadow_end_color = 2131099842;
|
||||
public static final int design_fab_shadow_mid_color = 2131099843;
|
||||
public static final int design_fab_shadow_start_color = 2131099844;
|
||||
public static final int design_fab_stroke_end_inner_color = 2131099845;
|
||||
public static final int design_fab_stroke_end_outer_color = 2131099846;
|
||||
public static final int design_fab_stroke_top_inner_color = 2131099847;
|
||||
public static final int design_fab_stroke_top_outer_color = 2131099848;
|
||||
public static final int design_snackbar_background_color = 2131099849;
|
||||
public static final int design_tint_password_toggle = 2131099850;
|
||||
public static final int dim_foreground_disabled_material_dark = 2131099851;
|
||||
public static final int dim_foreground_disabled_material_light = 2131099852;
|
||||
public static final int dim_foreground_material_dark = 2131099853;
|
||||
public static final int dim_foreground_material_light = 2131099854;
|
||||
public static final int error_color_material_dark = 2131099857;
|
||||
public static final int error_color_material_light = 2131099858;
|
||||
public static final int foreground_material_dark = 2131099859;
|
||||
public static final int foreground_material_light = 2131099860;
|
||||
public static final int gallery_record_progress = 2131099861;
|
||||
public static final int highlighted_text_material_dark = 2131099863;
|
||||
public static final int highlighted_text_material_light = 2131099864;
|
||||
public static final int mask = 2131099886;
|
||||
public static final int material_blue_grey_800 = 2131099887;
|
||||
public static final int material_blue_grey_900 = 2131099888;
|
||||
public static final int material_blue_grey_950 = 2131099889;
|
||||
public static final int material_deep_teal_200 = 2131099890;
|
||||
public static final int material_deep_teal_500 = 2131099891;
|
||||
public static final int material_grey_100 = 2131099892;
|
||||
public static final int material_grey_300 = 2131099893;
|
||||
public static final int material_grey_50 = 2131099894;
|
||||
public static final int material_grey_600 = 2131099895;
|
||||
public static final int material_grey_800 = 2131099896;
|
||||
public static final int material_grey_850 = 2131099897;
|
||||
public static final int material_grey_900 = 2131099898;
|
||||
public static final int mtrl_bottom_nav_colored_item_tint = 2131099900;
|
||||
public static final int mtrl_bottom_nav_item_tint = 2131099901;
|
||||
public static final int mtrl_btn_bg_color_disabled = 2131099902;
|
||||
public static final int mtrl_btn_bg_color_selector = 2131099903;
|
||||
public static final int mtrl_btn_ripple_color = 2131099904;
|
||||
public static final int mtrl_btn_stroke_color_selector = 2131099905;
|
||||
public static final int mtrl_btn_text_btn_ripple_color = 2131099906;
|
||||
public static final int mtrl_btn_text_color_disabled = 2131099907;
|
||||
public static final int mtrl_btn_text_color_selector = 2131099908;
|
||||
public static final int mtrl_btn_transparent_bg_color = 2131099909;
|
||||
public static final int mtrl_chip_background_color = 2131099910;
|
||||
public static final int mtrl_chip_close_icon_tint = 2131099911;
|
||||
public static final int mtrl_chip_ripple_color = 2131099912;
|
||||
public static final int mtrl_chip_text_color = 2131099913;
|
||||
public static final int mtrl_fab_ripple_color = 2131099914;
|
||||
public static final int mtrl_scrim_color = 2131099915;
|
||||
public static final int mtrl_tabs_colored_ripple_color = 2131099916;
|
||||
public static final int mtrl_tabs_icon_color_selector = 2131099917;
|
||||
public static final int mtrl_tabs_icon_color_selector_colored = 2131099918;
|
||||
public static final int mtrl_tabs_legacy_text_color_selector = 2131099919;
|
||||
public static final int mtrl_tabs_ripple_color = 2131099920;
|
||||
public static final int mtrl_text_btn_text_color_selector = 2131099921;
|
||||
public static final int mtrl_textinput_default_box_stroke_color = 2131099922;
|
||||
public static final int mtrl_textinput_disabled_color = 2131099923;
|
||||
public static final int mtrl_textinput_filled_box_default_background_color = 2131099924;
|
||||
public static final int mtrl_textinput_hovered_box_stroke_color = 2131099925;
|
||||
public static final int notification_action_color_filter = 2131099926;
|
||||
public static final int notification_icon_bg_color = 2131099927;
|
||||
public static final int notification_material_background_media_default_color = 2131099928;
|
||||
public static final int primary_dark_material_dark = 2131099930;
|
||||
public static final int primary_dark_material_light = 2131099931;
|
||||
public static final int primary_material_dark = 2131099932;
|
||||
public static final int primary_material_light = 2131099933;
|
||||
public static final int primary_text_default_material_dark = 2131099934;
|
||||
public static final int primary_text_default_material_light = 2131099935;
|
||||
public static final int primary_text_disabled_material_dark = 2131099936;
|
||||
public static final int primary_text_disabled_material_light = 2131099937;
|
||||
public static final int ripple_material_dark = 2131099945;
|
||||
public static final int ripple_material_light = 2131099946;
|
||||
public static final int secondary_text_default_material_dark = 2131099947;
|
||||
public static final int secondary_text_default_material_light = 2131099948;
|
||||
public static final int secondary_text_disabled_material_dark = 2131099949;
|
||||
public static final int secondary_text_disabled_material_light = 2131099950;
|
||||
public static final int snackbar_level_error = 2131099954;
|
||||
public static final int snackbar_level_success = 2131099955;
|
||||
public static final int snackbar_level_waiting = 2131099956;
|
||||
public static final int switch_thumb_disabled_material_dark = 2131099958;
|
||||
public static final int switch_thumb_disabled_material_light = 2131099959;
|
||||
public static final int switch_thumb_material_dark = 2131099960;
|
||||
public static final int switch_thumb_material_light = 2131099961;
|
||||
public static final int switch_thumb_normal_material_dark = 2131099962;
|
||||
public static final int switch_thumb_normal_material_light = 2131099963;
|
||||
public static final int theme_action_txt = 2131099966;
|
||||
public static final int theme_background = 2131099967;
|
||||
public static final int theme_btn_bg = 2131099968;
|
||||
public static final int theme_btn_txt = 2131099969;
|
||||
public static final int theme_divider_line = 2131099970;
|
||||
public static final int theme_input_hint = 2131099971;
|
||||
public static final int theme_input_txt = 2131099972;
|
||||
public static final int theme_item_bg_pressed = 2131099973;
|
||||
public static final int theme_menu_bg = 2131099974;
|
||||
public static final int theme_msg = 2131099975;
|
||||
public static final int theme_txt = 2131099976;
|
||||
public static final int theme_txt_light = 2131099977;
|
||||
public static final int theme_txt_orange = 2131099978;
|
||||
public static final int theme_txt_red = 2131099979;
|
||||
public static final int tooltip_background_dark = 2131099980;
|
||||
public static final int tooltip_background_light = 2131099981;
|
||||
public static final int tw__blue_default = 2131099986;
|
||||
public static final int tw__blue_pressed = 2131099987;
|
||||
public static final int tw__blue_pressed_light = 2131099988;
|
||||
public static final int tw__composer_black = 2131099989;
|
||||
public static final int tw__composer_blue = 2131099990;
|
||||
public static final int tw__composer_blue_text = 2131099991;
|
||||
public static final int tw__composer_deep_gray = 2131099992;
|
||||
public static final int tw__composer_light_gray = 2131099993;
|
||||
public static final int tw__composer_red = 2131099994;
|
||||
public static final int tw__composer_white = 2131099995;
|
||||
public static final int tw__cta_border_color = 2131099996;
|
||||
public static final int tw__cta_text_color = 2131099997;
|
||||
public static final int tw__light_gray = 2131099998;
|
||||
public static final int tw__seekbar_thumb_inner_color = 2131099999;
|
||||
public static final int tw__seekbar_thumb_outer_color = 2131100000;
|
||||
public static final int tw__solid_white = 2131100001;
|
||||
public static final int tw__transparent = 2131100002;
|
||||
public static final int tw__tweet_action_color = 2131100003;
|
||||
public static final int tw__tweet_action_dark_highlight_color = 2131100004;
|
||||
public static final int tw__tweet_action_light_highlight_color = 2131100005;
|
||||
public static final int tw__tweet_dark_container_bg_color = 2131100006;
|
||||
public static final int tw__tweet_dark_primary_text_color = 2131100007;
|
||||
public static final int tw__tweet_light_container_bg_color = 2131100008;
|
||||
public static final int tw__tweet_light_primary_text_color = 2131100009;
|
||||
public static final int video_mask = 2131100052;
|
||||
}
|
357
sources/com/bottle/hp/album/R$id.java
Normal file
357
sources/com/bottle/hp/album/R$id.java
Normal file
@@ -0,0 +1,357 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$id {
|
||||
public static final int action0 = 2131296268;
|
||||
public static final int action_bar = 2131296272;
|
||||
public static final int action_bar_activity_content = 2131296273;
|
||||
public static final int action_bar_container = 2131296274;
|
||||
public static final int action_bar_root = 2131296275;
|
||||
public static final int action_bar_spinner = 2131296276;
|
||||
public static final int action_bar_subtitle = 2131296277;
|
||||
public static final int action_bar_title = 2131296278;
|
||||
public static final int action_container = 2131296279;
|
||||
public static final int action_context_bar = 2131296280;
|
||||
public static final int action_divider = 2131296281;
|
||||
public static final int action_image = 2131296282;
|
||||
public static final int action_menu_divider = 2131296283;
|
||||
public static final int action_menu_presenter = 2131296284;
|
||||
public static final int action_mode_bar = 2131296285;
|
||||
public static final int action_mode_bar_stub = 2131296286;
|
||||
public static final int action_mode_close_button = 2131296287;
|
||||
public static final int action_text = 2131296288;
|
||||
public static final int actions = 2131296289;
|
||||
public static final int activity_chooser_view_content = 2131296290;
|
||||
public static final int activity_gallery = 2131296291;
|
||||
public static final int activity_media_player_img_back = 2131296292;
|
||||
public static final int activity_media_player_img_play = 2131296293;
|
||||
public static final int activity_media_player_img_snagshot = 2131296294;
|
||||
public static final int activity_media_player_img_start = 2131296295;
|
||||
public static final int activity_media_player_layout_control = 2131296296;
|
||||
public static final int activity_media_player_pb = 2131296297;
|
||||
public static final int activity_media_player_surface = 2131296298;
|
||||
public static final int activity_media_player_tv_reset = 2131296299;
|
||||
public static final int adapter_gallery_item_cb_selected = 2131296307;
|
||||
public static final int adapter_gallery_item_img_snapshoot = 2131296308;
|
||||
public static final int add = 2131296309;
|
||||
public static final int adjust_height = 2131296311;
|
||||
public static final int adjust_width = 2131296312;
|
||||
public static final int alertTitle = 2131296315;
|
||||
public static final int always = 2131296317;
|
||||
public static final int async = 2131296326;
|
||||
public static final int auto = 2131296327;
|
||||
public static final int automatic = 2131296328;
|
||||
public static final int beginning = 2131296339;
|
||||
public static final int blocking = 2131296343;
|
||||
public static final int bottom = 2131296348;
|
||||
public static final int bottom_separator = 2131296352;
|
||||
public static final int box_count = 2131296353;
|
||||
public static final int browser_actions_header_text = 2131296354;
|
||||
public static final int browser_actions_menu_item_icon = 2131296355;
|
||||
public static final int browser_actions_menu_item_text = 2131296356;
|
||||
public static final int browser_actions_menu_items = 2131296357;
|
||||
public static final int browser_actions_menu_view = 2131296358;
|
||||
public static final int btnCompleted = 2131296365;
|
||||
public static final int btn_blue_cancel = 2131296373;
|
||||
public static final int btn_gray_cancel = 2131296379;
|
||||
public static final int btn_ok = 2131296386;
|
||||
public static final int button = 2131296398;
|
||||
public static final int buttonPanel = 2131296399;
|
||||
public static final int call_to_action_view = 2131296400;
|
||||
public static final int cancel_action = 2131296403;
|
||||
public static final int cancel_button = 2131296404;
|
||||
public static final int cbChoose = 2131296425;
|
||||
public static final int center = 2131296441;
|
||||
public static final int checkbox = 2131296449;
|
||||
public static final int chronometer = 2131296452;
|
||||
public static final int collapseActionView = 2131296459;
|
||||
public static final int com_facebook_body_frame = 2131296463;
|
||||
public static final int com_facebook_button_xout = 2131296464;
|
||||
public static final int com_facebook_device_auth_instructions = 2131296465;
|
||||
public static final int com_facebook_fragment_container = 2131296466;
|
||||
public static final int com_facebook_login_activity_progress_bar = 2131296467;
|
||||
public static final int com_facebook_smart_instructions_0 = 2131296468;
|
||||
public static final int com_facebook_smart_instructions_or = 2131296469;
|
||||
public static final int com_facebook_tooltip_bubble_view_bottom_pointer = 2131296470;
|
||||
public static final int com_facebook_tooltip_bubble_view_text_body = 2131296471;
|
||||
public static final int com_facebook_tooltip_bubble_view_top_pointer = 2131296472;
|
||||
public static final int confirmation_code = 2131296478;
|
||||
public static final int container = 2131296480;
|
||||
public static final int content = 2131296481;
|
||||
public static final int contentPanel = 2131296485;
|
||||
public static final int coordinator = 2131296497;
|
||||
public static final int custom = 2131296508;
|
||||
public static final int customPanel = 2131296509;
|
||||
public static final int dark = 2131296519;
|
||||
public static final int decor_content_parent = 2131296525;
|
||||
public static final int default_activity_button = 2131296526;
|
||||
public static final int design_bottom_sheet = 2131296529;
|
||||
public static final int design_menu_item_action_area = 2131296530;
|
||||
public static final int design_menu_item_action_area_stub = 2131296531;
|
||||
public static final int design_menu_item_text = 2131296532;
|
||||
public static final int design_navigation_view = 2131296533;
|
||||
public static final int disableHome = 2131296537;
|
||||
public static final int display_always = 2131296539;
|
||||
public static final int edit_query = 2131296556;
|
||||
public static final int end = 2131296567;
|
||||
public static final int end_padder = 2131296568;
|
||||
public static final int expand_activities_button = 2131296594;
|
||||
public static final int expanded_menu = 2131296595;
|
||||
public static final int fill = 2131296607;
|
||||
public static final int filled = 2131296610;
|
||||
public static final int fixed = 2131296616;
|
||||
public static final int flVideoViewContainer = 2131296621;
|
||||
public static final int forever = 2131296644;
|
||||
public static final int ghost_view = 2131296650;
|
||||
public static final int gone = 2131296667;
|
||||
public static final int gridView = 2131296669;
|
||||
public static final int grid_view = 2131296670;
|
||||
public static final int group_divider = 2131296671;
|
||||
public static final int hackyViewPager = 2131296684;
|
||||
public static final int heart_off = 2131296690;
|
||||
public static final int heart_on = 2131296691;
|
||||
public static final int height = 2131296692;
|
||||
public static final int home = 2131296696;
|
||||
public static final int homeAsUp = 2131296697;
|
||||
public static final int icon = 2131296701;
|
||||
public static final int icon_group = 2131296702;
|
||||
public static final int icon_only = 2131296704;
|
||||
public static final int ifRoom = 2131296705;
|
||||
public static final int image = 2131296817;
|
||||
public static final int imageView = 2131296818;
|
||||
public static final int imgAccept = 2131296822;
|
||||
public static final int imgBack = 2131296823;
|
||||
public static final int imgCancel = 2131296824;
|
||||
public static final int imgCapture = 2131296825;
|
||||
public static final int imgCaptureBackground = 2131296826;
|
||||
public static final int imgChangeCamera = 2131296827;
|
||||
public static final int imgDelete = 2131296837;
|
||||
public static final int imgLogo = 2131296851;
|
||||
public static final int imgMask = 2131296852;
|
||||
public static final int imgOK = 2131296865;
|
||||
public static final int imgPlay = 2131296866;
|
||||
public static final int imgPreview = 2131296870;
|
||||
public static final int imgSelectVideo = 2131296882;
|
||||
public static final int imgStartPlay = 2131296886;
|
||||
public static final int img_snapshoot = 2131296953;
|
||||
public static final int info = 2131296971;
|
||||
public static final int inline = 2131296972;
|
||||
public static final int invisible = 2131296978;
|
||||
public static final int italic = 2131296980;
|
||||
public static final int item_touch_helper_previous_elevation = 2131296991;
|
||||
public static final int iv_icon = 2131297014;
|
||||
public static final int labeled = 2131297045;
|
||||
public static final int large = 2131297046;
|
||||
public static final int largeLabel = 2131297047;
|
||||
public static final int left = 2131297071;
|
||||
public static final int light = 2131297084;
|
||||
public static final int line1 = 2131297087;
|
||||
public static final int line3 = 2131297088;
|
||||
public static final int listMode = 2131297089;
|
||||
public static final int list_item = 2131297090;
|
||||
public static final int llVideo = 2131297102;
|
||||
public static final int masked = 2131297151;
|
||||
public static final int media_actions = 2131297154;
|
||||
public static final int message = 2131297163;
|
||||
public static final int messenger_send_button = 2131297164;
|
||||
public static final int middle = 2131297168;
|
||||
public static final int mini = 2131297170;
|
||||
public static final int mtrl_child_content_container = 2131297179;
|
||||
public static final int mtrl_internal_children_alpha_tag = 2131297180;
|
||||
public static final int multiply = 2131297181;
|
||||
public static final int navigation_header_container = 2131297185;
|
||||
public static final int never = 2131297188;
|
||||
public static final int never_display = 2131297189;
|
||||
public static final int none = 2131297193;
|
||||
public static final int normal = 2131297194;
|
||||
public static final int notification_background = 2131297195;
|
||||
public static final int notification_main_column = 2131297196;
|
||||
public static final int notification_main_column_container = 2131297197;
|
||||
public static final int open_graph = 2131297204;
|
||||
public static final int outline = 2131297205;
|
||||
public static final int packed = 2131297207;
|
||||
public static final int page = 2131297208;
|
||||
public static final int parallax = 2131297213;
|
||||
public static final int parent = 2131297214;
|
||||
public static final int parentPanel = 2131297216;
|
||||
public static final int parent_matrix = 2131297217;
|
||||
public static final int percent = 2131297227;
|
||||
public static final int photoView = 2131297234;
|
||||
public static final int pictureCaptureView = 2131297236;
|
||||
public static final int pin = 2131297237;
|
||||
public static final int popLayoutId = 2131297243;
|
||||
public static final int progressBar = 2131297253;
|
||||
public static final int progress_bar = 2131297254;
|
||||
public static final int progress_circular = 2131297255;
|
||||
public static final int progress_horizontal = 2131297256;
|
||||
public static final int push_notification_bg = 2131297261;
|
||||
public static final int push_notification_big_icon = 2131297262;
|
||||
public static final int push_notification_content = 2131297263;
|
||||
public static final int push_notification_content_one_line = 2131297264;
|
||||
public static final int push_notification_date = 2131297265;
|
||||
public static final int push_notification_dot = 2131297266;
|
||||
public static final int push_notification_layout_lefttop = 2131297267;
|
||||
public static final int push_notification_small_icon = 2131297268;
|
||||
public static final int push_notification_style_1 = 2131297269;
|
||||
public static final int push_notification_style_1_big_icon = 2131297270;
|
||||
public static final int push_notification_style_1_content = 2131297271;
|
||||
public static final int push_notification_style_1_date = 2131297272;
|
||||
public static final int push_notification_style_1_title = 2131297273;
|
||||
public static final int push_notification_style_default = 2131297274;
|
||||
public static final int push_notification_sub_title = 2131297275;
|
||||
public static final int push_notification_title = 2131297276;
|
||||
public static final int push_root_view = 2131297277;
|
||||
public static final int quote_tweet_holder = 2131297283;
|
||||
public static final int radio = 2131297284;
|
||||
public static final int right = 2131297305;
|
||||
public static final int right_icon = 2131297308;
|
||||
public static final int right_side = 2131297309;
|
||||
public static final int rlActionBar = 2131297310;
|
||||
public static final int rlBottom = 2131297311;
|
||||
public static final int rlProgress = 2131297313;
|
||||
public static final int rlTitle = 2131297315;
|
||||
public static final int rlTop = 2131297316;
|
||||
public static final int rlVideoViewContainer = 2131297317;
|
||||
public static final int rl_error = 2131297334;
|
||||
public static final int root = 2131297403;
|
||||
public static final int save_image_matrix = 2131297437;
|
||||
public static final int save_non_transition_alpha = 2131297438;
|
||||
public static final int save_scale_type = 2131297439;
|
||||
public static final int screen = 2131297445;
|
||||
public static final int scrollIndicatorDown = 2131297447;
|
||||
public static final int scrollIndicatorUp = 2131297448;
|
||||
public static final int scrollView = 2131297449;
|
||||
public static final int scrollable = 2131297450;
|
||||
public static final int search_badge = 2131297451;
|
||||
public static final int search_bar = 2131297452;
|
||||
public static final int search_button = 2131297453;
|
||||
public static final int search_close_btn = 2131297454;
|
||||
public static final int search_edit_frame = 2131297455;
|
||||
public static final int search_go_btn = 2131297456;
|
||||
public static final int search_mag_icon = 2131297457;
|
||||
public static final int search_plate = 2131297458;
|
||||
public static final int search_src_text = 2131297459;
|
||||
public static final int search_voice_btn = 2131297460;
|
||||
public static final int select_dialog_listview = 2131297462;
|
||||
public static final int selected = 2131297463;
|
||||
public static final int shortcut = 2131297475;
|
||||
public static final int showCustom = 2131297476;
|
||||
public static final int showHome = 2131297477;
|
||||
public static final int showTitle = 2131297478;
|
||||
public static final int small = 2131297483;
|
||||
public static final int smallLabel = 2131297484;
|
||||
public static final int snackbar_action = 2131297485;
|
||||
public static final int snackbar_text = 2131297486;
|
||||
public static final int spacer = 2131297490;
|
||||
public static final int spinner = 2131297491;
|
||||
public static final int split_action_bar = 2131297493;
|
||||
public static final int spread = 2131297494;
|
||||
public static final int spread_inside = 2131297495;
|
||||
public static final int src_atop = 2131297496;
|
||||
public static final int src_in = 2131297497;
|
||||
public static final int src_over = 2131297498;
|
||||
public static final int standard = 2131297499;
|
||||
public static final int start = 2131297500;
|
||||
public static final int status_bar_latest_event_content = 2131297504;
|
||||
public static final int stretch = 2131297509;
|
||||
public static final int submenuarrow = 2131297512;
|
||||
public static final int submit_area = 2131297513;
|
||||
public static final int surfaceView = 2131297516;
|
||||
public static final int tabMode = 2131297522;
|
||||
public static final int tag_transition_group = 2131297528;
|
||||
public static final int tag_unhandled_key_event_manager = 2131297529;
|
||||
public static final int tag_unhandled_key_listeners = 2131297530;
|
||||
public static final int text = 2131297537;
|
||||
public static final int text2 = 2131297538;
|
||||
public static final int textSpacerNoButtons = 2131297539;
|
||||
public static final int textSpacerNoTitle = 2131297540;
|
||||
public static final int textView = 2131297542;
|
||||
public static final int text_input_password_toggle = 2131297545;
|
||||
public static final int textinput_counter = 2131297546;
|
||||
public static final int textinput_error = 2131297547;
|
||||
public static final int textinput_helper_text = 2131297548;
|
||||
public static final int time = 2131297551;
|
||||
public static final int title = 2131297555;
|
||||
public static final int titleDividerNoCustom = 2131297556;
|
||||
public static final int title_template = 2131297565;
|
||||
public static final int top = 2131297568;
|
||||
public static final int topPanel = 2131297569;
|
||||
public static final int touch_outside = 2131297571;
|
||||
public static final int transition_current_scene = 2131297572;
|
||||
public static final int transition_layout_save = 2131297573;
|
||||
public static final int transition_position = 2131297574;
|
||||
public static final int transition_scene_layoutid_cache = 2131297575;
|
||||
public static final int transition_transform = 2131297576;
|
||||
public static final int tvCapture = 2131297581;
|
||||
public static final int tvCurrent = 2131297593;
|
||||
public static final int tvDialogTitle = 2131297595;
|
||||
public static final int tvDuration = 2131297602;
|
||||
public static final int tvTips = 2131297631;
|
||||
public static final int tvTitle = 2131297632;
|
||||
public static final int tv_msg = 2131297723;
|
||||
public static final int tv_preview = 2131297759;
|
||||
public static final int tv_retry = 2131297775;
|
||||
public static final int tv_unknown_error = 2131297823;
|
||||
public static final int tw__allow_btn = 2131297842;
|
||||
public static final int tw__app_image = 2131297843;
|
||||
public static final int tw__app_info_layout = 2131297844;
|
||||
public static final int tw__app_install_button = 2131297845;
|
||||
public static final int tw__app_name = 2131297846;
|
||||
public static final int tw__app_store_name = 2131297847;
|
||||
public static final int tw__aspect_ratio_media_container = 2131297848;
|
||||
public static final int tw__author_attribution = 2131297849;
|
||||
public static final int tw__author_avatar = 2131297850;
|
||||
public static final int tw__card_view = 2131297851;
|
||||
public static final int tw__char_count = 2131297852;
|
||||
public static final int tw__composer_close = 2131297853;
|
||||
public static final int tw__composer_header = 2131297854;
|
||||
public static final int tw__composer_profile_divider = 2131297855;
|
||||
public static final int tw__composer_scroll_view = 2131297856;
|
||||
public static final int tw__composer_toolbar = 2131297857;
|
||||
public static final int tw__composer_toolbar_divider = 2131297858;
|
||||
public static final int tw__composer_view = 2131297859;
|
||||
public static final int tw__current_time = 2131297860;
|
||||
public static final int tw__duration = 2131297861;
|
||||
public static final int tw__edit_tweet = 2131297862;
|
||||
public static final int tw__entity_index = 2131297863;
|
||||
public static final int tw__gif_badge = 2131297864;
|
||||
public static final int tw__not_now_btn = 2131297865;
|
||||
public static final int tw__post_tweet = 2131297866;
|
||||
public static final int tw__progress = 2131297867;
|
||||
public static final int tw__share_email_desc = 2131297868;
|
||||
public static final int tw__spinner = 2131297869;
|
||||
public static final int tw__state_control = 2131297870;
|
||||
public static final int tw__tweet_action_bar = 2131297871;
|
||||
public static final int tw__tweet_author_avatar = 2131297872;
|
||||
public static final int tw__tweet_author_full_name = 2131297873;
|
||||
public static final int tw__tweet_author_screen_name = 2131297874;
|
||||
public static final int tw__tweet_like_button = 2131297875;
|
||||
public static final int tw__tweet_media_badge = 2131297876;
|
||||
public static final int tw__tweet_retweeted_by = 2131297877;
|
||||
public static final int tw__tweet_share_button = 2131297878;
|
||||
public static final int tw__tweet_text = 2131297879;
|
||||
public static final int tw__tweet_timestamp = 2131297880;
|
||||
public static final int tw__twitter_logo = 2131297881;
|
||||
public static final int tw__video_duration = 2131297882;
|
||||
public static final int tw__view_pager = 2131297883;
|
||||
public static final int tw__web_view = 2131297884;
|
||||
public static final int tweet_media_view = 2131297885;
|
||||
public static final int uniform = 2131297895;
|
||||
public static final int unknown = 2131297896;
|
||||
public static final int unlabeled = 2131297897;
|
||||
public static final int up = 2131297898;
|
||||
public static final int useLogo = 2131297902;
|
||||
public static final int videoCaptureView = 2131297916;
|
||||
public static final int video_control_view = 2131297918;
|
||||
public static final int video_progress_view = 2131297919;
|
||||
public static final int video_view = 2131297920;
|
||||
public static final int view_offset_helper = 2131297946;
|
||||
public static final int visible = 2131297955;
|
||||
public static final int wide = 2131297982;
|
||||
public static final int width = 2131297983;
|
||||
public static final int withText = 2131297984;
|
||||
public static final int wrap = 2131297985;
|
||||
public static final int wrap_content = 2131297986;
|
||||
public static final int wvPopwin = 2131297987;
|
||||
public static final int wv_content = 2131297988;
|
||||
}
|
120
sources/com/bottle/hp/album/R$layout.java
Normal file
120
sources/com/bottle/hp/album/R$layout.java
Normal file
@@ -0,0 +1,120 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$layout {
|
||||
public static final int abc_action_bar_title_item = 2131492864;
|
||||
public static final int abc_action_bar_up_container = 2131492865;
|
||||
public static final int abc_action_menu_item_layout = 2131492866;
|
||||
public static final int abc_action_menu_layout = 2131492867;
|
||||
public static final int abc_action_mode_bar = 2131492868;
|
||||
public static final int abc_action_mode_close_item_material = 2131492869;
|
||||
public static final int abc_activity_chooser_view = 2131492870;
|
||||
public static final int abc_activity_chooser_view_list_item = 2131492871;
|
||||
public static final int abc_alert_dialog_button_bar_material = 2131492872;
|
||||
public static final int abc_alert_dialog_material = 2131492873;
|
||||
public static final int abc_alert_dialog_title_material = 2131492874;
|
||||
public static final int abc_cascading_menu_item_layout = 2131492875;
|
||||
public static final int abc_dialog_title_material = 2131492876;
|
||||
public static final int abc_expanded_menu_layout = 2131492877;
|
||||
public static final int abc_list_menu_item_checkbox = 2131492878;
|
||||
public static final int abc_list_menu_item_icon = 2131492879;
|
||||
public static final int abc_list_menu_item_layout = 2131492880;
|
||||
public static final int abc_list_menu_item_radio = 2131492881;
|
||||
public static final int abc_popup_menu_header_item_layout = 2131492882;
|
||||
public static final int abc_popup_menu_item_layout = 2131492883;
|
||||
public static final int abc_screen_content_include = 2131492884;
|
||||
public static final int abc_screen_simple = 2131492885;
|
||||
public static final int abc_screen_simple_overlay_action_mode = 2131492886;
|
||||
public static final int abc_screen_toolbar = 2131492887;
|
||||
public static final int abc_search_dropdown_item_icons_2line = 2131492888;
|
||||
public static final int abc_search_view = 2131492889;
|
||||
public static final int abc_select_dialog_material = 2131492890;
|
||||
public static final int abc_tooltip = 2131492891;
|
||||
public static final int activity_album = 2131492904;
|
||||
public static final int activity_album2 = 2131492905;
|
||||
public static final int activity_gallery = 2131492934;
|
||||
public static final int activity_gallery_preview = 2131492935;
|
||||
public static final int activity_media_player = 2131492945;
|
||||
public static final int activity_photo_editor = 2131492954;
|
||||
public static final int activity_picture_capture = 2131492955;
|
||||
public static final int activity_video_capture = 2131492986;
|
||||
public static final int activity_video_preview = 2131492987;
|
||||
public static final int adapter_album = 2131492991;
|
||||
public static final int adapter_album2 = 2131492992;
|
||||
public static final int adapter_gallery = 2131492994;
|
||||
public static final int adapter_gallery_item = 2131492995;
|
||||
public static final int adapter_photo_eidtor = 2131492996;
|
||||
public static final int browser_actions_context_menu_page = 2131493011;
|
||||
public static final int browser_actions_context_menu_row = 2131493012;
|
||||
public static final int com_facebook_activity_layout = 2131493015;
|
||||
public static final int com_facebook_device_auth_dialog_fragment = 2131493016;
|
||||
public static final int com_facebook_login_fragment = 2131493017;
|
||||
public static final int com_facebook_smart_device_dialog_fragment = 2131493018;
|
||||
public static final int com_facebook_tooltip_bubble = 2131493019;
|
||||
public static final int comm_dialog_big = 2131493020;
|
||||
public static final int comm_dialog_simple = 2131493021;
|
||||
public static final int comm_dialog_two_btn = 2131493022;
|
||||
public static final int comm_error = 2131493023;
|
||||
public static final int comm_layout_toast = 2131493025;
|
||||
public static final int design_bottom_navigation_item = 2131493036;
|
||||
public static final int design_bottom_sheet_dialog = 2131493037;
|
||||
public static final int design_layout_snackbar = 2131493038;
|
||||
public static final int design_layout_snackbar_include = 2131493039;
|
||||
public static final int design_layout_tab_icon = 2131493040;
|
||||
public static final int design_layout_tab_text = 2131493041;
|
||||
public static final int design_menu_item_action_area = 2131493042;
|
||||
public static final int design_navigation_item = 2131493043;
|
||||
public static final int design_navigation_item_header = 2131493044;
|
||||
public static final int design_navigation_item_separator = 2131493045;
|
||||
public static final int design_navigation_item_subheader = 2131493046;
|
||||
public static final int design_navigation_menu = 2131493047;
|
||||
public static final int design_navigation_menu_item = 2131493048;
|
||||
public static final int design_text_input_password_icon = 2131493049;
|
||||
public static final int jpush_popwin_layout = 2131493212;
|
||||
public static final int jpush_webview_layout = 2131493213;
|
||||
public static final int lay_webview = 2131493231;
|
||||
public static final int messenger_button_send_blue_large = 2131493279;
|
||||
public static final int messenger_button_send_blue_round = 2131493280;
|
||||
public static final int messenger_button_send_blue_small = 2131493281;
|
||||
public static final int messenger_button_send_white_large = 2131493282;
|
||||
public static final int messenger_button_send_white_round = 2131493283;
|
||||
public static final int messenger_button_send_white_small = 2131493284;
|
||||
public static final int mtrl_layout_snackbar = 2131493286;
|
||||
public static final int mtrl_layout_snackbar_include = 2131493287;
|
||||
public static final int notification_action = 2131493288;
|
||||
public static final int notification_action_tombstone = 2131493289;
|
||||
public static final int notification_media_action = 2131493290;
|
||||
public static final int notification_media_cancel_action = 2131493291;
|
||||
public static final int notification_template_big_media = 2131493292;
|
||||
public static final int notification_template_big_media_custom = 2131493293;
|
||||
public static final int notification_template_big_media_narrow = 2131493294;
|
||||
public static final int notification_template_big_media_narrow_custom = 2131493295;
|
||||
public static final int notification_template_custom_big = 2131493296;
|
||||
public static final int notification_template_icon_group = 2131493297;
|
||||
public static final int notification_template_lines_media = 2131493298;
|
||||
public static final int notification_template_media = 2131493299;
|
||||
public static final int notification_template_media_custom = 2131493300;
|
||||
public static final int notification_template_part_chronometer = 2131493301;
|
||||
public static final int notification_template_part_time = 2131493302;
|
||||
public static final int push_notification = 2131493314;
|
||||
public static final int select_dialog_item_material = 2131493348;
|
||||
public static final int select_dialog_multichoice_material = 2131493349;
|
||||
public static final int select_dialog_singlechoice_material = 2131493350;
|
||||
public static final int support_simple_spinner_dropdown_item = 2131493355;
|
||||
public static final int tw__action_bar = 2131493362;
|
||||
public static final int tw__activity_composer = 2131493363;
|
||||
public static final int tw__activity_oauth = 2131493364;
|
||||
public static final int tw__activity_share_email = 2131493365;
|
||||
public static final int tw__app_card = 2131493366;
|
||||
public static final int tw__composer_view = 2131493367;
|
||||
public static final int tw__gallery_activity = 2131493368;
|
||||
public static final int tw__media_badge = 2131493369;
|
||||
public static final int tw__player_activity = 2131493370;
|
||||
public static final int tw__tweet = 2131493371;
|
||||
public static final int tw__tweet_compact = 2131493372;
|
||||
public static final int tw__tweet_quote = 2131493373;
|
||||
public static final int tw__video_control = 2131493374;
|
||||
public static final int video_play_fragment = 2131493379;
|
||||
public static final int view_picture_capture = 2131493381;
|
||||
public static final int view_video_capture = 2131493385;
|
||||
}
|
37
sources/com/bottle/hp/album/R$mipmap.java
Normal file
37
sources/com/bottle/hp/album/R$mipmap.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$mipmap {
|
||||
public static final int accept_capture = 2131623936;
|
||||
public static final int back = 2131623946;
|
||||
public static final int back_circle_checked = 2131623947;
|
||||
public static final int camera = 2131623961;
|
||||
public static final int capture = 2131623962;
|
||||
public static final int capture_videotape = 2131623963;
|
||||
public static final int change_camera = 2131623964;
|
||||
public static final int circle_ui = 2131623965;
|
||||
public static final int circle_ui_pad = 2131623966;
|
||||
public static final int circle_ui_press = 2131623967;
|
||||
public static final int circle_ui_press_pad = 2131623968;
|
||||
public static final int community_cancel = 2131623971;
|
||||
public static final int community_load_failed = 2131623977;
|
||||
public static final int community_load_failed_pad = 2131623978;
|
||||
public static final int community_my_collection_complete = 2131623979;
|
||||
public static final int delete = 2131624025;
|
||||
public static final int diy_title_back = 2131624026;
|
||||
public static final int gallery_community_collection_icon = 2131624030;
|
||||
public static final int ic_back = 2131624037;
|
||||
public static final int ic_launcher = 2131624049;
|
||||
public static final int ic_launcher_round = 2131624052;
|
||||
public static final int icon_dialog_close = 2131624062;
|
||||
public static final int load_failed = 2131624075;
|
||||
public static final int play_video = 2131624094;
|
||||
public static final int re_capture = 2131624095;
|
||||
public static final int retry = 2131624101;
|
||||
public static final int selected_img = 2131624104;
|
||||
public static final int un_select_img = 2131624129;
|
||||
public static final int video_player_back = 2131624132;
|
||||
public static final int video_record = 2131624133;
|
||||
public static final int video_start = 2131624134;
|
||||
public static final int video_stop = 2131624135;
|
||||
}
|
174
sources/com/bottle/hp/album/R$string.java
Normal file
174
sources/com/bottle/hp/album/R$string.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$string {
|
||||
public static final int abc_action_bar_home_description = 2131820553;
|
||||
public static final int abc_action_bar_up_description = 2131820554;
|
||||
public static final int abc_action_menu_overflow_description = 2131820555;
|
||||
public static final int abc_action_mode_done = 2131820556;
|
||||
public static final int abc_activity_chooser_view_see_all = 2131820557;
|
||||
public static final int abc_activitychooserview_choose_application = 2131820558;
|
||||
public static final int abc_capital_off = 2131820559;
|
||||
public static final int abc_capital_on = 2131820560;
|
||||
public static final int abc_font_family_body_1_material = 2131820561;
|
||||
public static final int abc_font_family_body_2_material = 2131820562;
|
||||
public static final int abc_font_family_button_material = 2131820563;
|
||||
public static final int abc_font_family_caption_material = 2131820564;
|
||||
public static final int abc_font_family_display_1_material = 2131820565;
|
||||
public static final int abc_font_family_display_2_material = 2131820566;
|
||||
public static final int abc_font_family_display_3_material = 2131820567;
|
||||
public static final int abc_font_family_display_4_material = 2131820568;
|
||||
public static final int abc_font_family_headline_material = 2131820569;
|
||||
public static final int abc_font_family_menu_material = 2131820570;
|
||||
public static final int abc_font_family_subhead_material = 2131820571;
|
||||
public static final int abc_font_family_title_material = 2131820572;
|
||||
public static final int abc_menu_alt_shortcut_label = 2131820573;
|
||||
public static final int abc_menu_ctrl_shortcut_label = 2131820574;
|
||||
public static final int abc_menu_delete_shortcut_label = 2131820575;
|
||||
public static final int abc_menu_enter_shortcut_label = 2131820576;
|
||||
public static final int abc_menu_function_shortcut_label = 2131820577;
|
||||
public static final int abc_menu_meta_shortcut_label = 2131820578;
|
||||
public static final int abc_menu_shift_shortcut_label = 2131820579;
|
||||
public static final int abc_menu_space_shortcut_label = 2131820580;
|
||||
public static final int abc_menu_sym_shortcut_label = 2131820581;
|
||||
public static final int abc_prepend_shortcut_label = 2131820582;
|
||||
public static final int abc_search_hint = 2131820583;
|
||||
public static final int abc_searchview_description_clear = 2131820584;
|
||||
public static final int abc_searchview_description_query = 2131820585;
|
||||
public static final int abc_searchview_description_search = 2131820586;
|
||||
public static final int abc_searchview_description_submit = 2131820587;
|
||||
public static final int abc_searchview_description_voice = 2131820588;
|
||||
public static final int abc_shareactionprovider_share_with = 2131820589;
|
||||
public static final int abc_shareactionprovider_share_with_application = 2131820590;
|
||||
public static final int abc_toolbar_collapse_description = 2131820591;
|
||||
public static final int app_name = 2131820649;
|
||||
public static final int appbar_scrolling_view_behavior = 2131820661;
|
||||
public static final int bottom_sheet_behavior = 2131820682;
|
||||
public static final int character_counter_content_description = 2131820730;
|
||||
public static final int character_counter_pattern = 2131820731;
|
||||
public static final int com_crashlytics_android_build_id = 2131820749;
|
||||
public static final int com_facebook_device_auth_instructions = 2131820750;
|
||||
public static final int com_facebook_image_download_unknown_error = 2131820751;
|
||||
public static final int com_facebook_internet_permission_error_message = 2131820752;
|
||||
public static final int com_facebook_internet_permission_error_title = 2131820753;
|
||||
public static final int com_facebook_like_button_liked = 2131820754;
|
||||
public static final int com_facebook_like_button_not_liked = 2131820755;
|
||||
public static final int com_facebook_loading = 2131820756;
|
||||
public static final int com_facebook_loginview_cancel_action = 2131820757;
|
||||
public static final int com_facebook_loginview_log_in_button = 2131820758;
|
||||
public static final int com_facebook_loginview_log_in_button_continue = 2131820759;
|
||||
public static final int com_facebook_loginview_log_in_button_long = 2131820762;
|
||||
public static final int com_facebook_loginview_log_out_action = 2131820763;
|
||||
public static final int com_facebook_loginview_log_out_button = 2131820766;
|
||||
public static final int com_facebook_loginview_logged_in_as = 2131820769;
|
||||
public static final int com_facebook_loginview_logged_in_using_facebook = 2131820772;
|
||||
public static final int com_facebook_send_button_text = 2131820775;
|
||||
public static final int com_facebook_share_button_text = 2131820778;
|
||||
public static final int com_facebook_smart_device_instructions = 2131820781;
|
||||
public static final int com_facebook_smart_device_instructions_or = 2131820782;
|
||||
public static final int com_facebook_smart_login_confirmation_cancel = 2131820783;
|
||||
public static final int com_facebook_smart_login_confirmation_continue_as = 2131820786;
|
||||
public static final int com_facebook_smart_login_confirmation_title = 2131820789;
|
||||
public static final int com_facebook_tooltip_default = 2131820792;
|
||||
public static final int comm_cancel = 2131820797;
|
||||
public static final int comm_ok = 2131820798;
|
||||
public static final int common_google_play_services_enable_button = 2131820814;
|
||||
public static final int common_google_play_services_enable_text = 2131820815;
|
||||
public static final int common_google_play_services_enable_title = 2131820816;
|
||||
public static final int common_google_play_services_install_button = 2131820817;
|
||||
public static final int common_google_play_services_install_text = 2131820818;
|
||||
public static final int common_google_play_services_install_title = 2131820819;
|
||||
public static final int common_google_play_services_notification_channel_name = 2131820820;
|
||||
public static final int common_google_play_services_notification_ticker = 2131820821;
|
||||
public static final int common_google_play_services_unknown_issue = 2131820822;
|
||||
public static final int common_google_play_services_unsupported_text = 2131820823;
|
||||
public static final int common_google_play_services_update_button = 2131820824;
|
||||
public static final int common_google_play_services_update_text = 2131820825;
|
||||
public static final int common_google_play_services_update_title = 2131820826;
|
||||
public static final int common_google_play_services_updating_text = 2131820827;
|
||||
public static final int common_google_play_services_wear_update_text = 2131820828;
|
||||
public static final int common_open_on_phone = 2131820829;
|
||||
public static final int common_signin_button_text = 2131820830;
|
||||
public static final int common_signin_button_text_long = 2131820831;
|
||||
public static final int cover = 2131820888;
|
||||
public static final int done = 2131820967;
|
||||
public static final int fab_transformation_scrim_behavior = 2131821018;
|
||||
public static final int fab_transformation_sheet_behavior = 2131821019;
|
||||
public static final int hide_bottom_view_on_scroll_behavior = 2131821117;
|
||||
public static final int jg_channel_name_p_default = 2131821170;
|
||||
public static final int jg_channel_name_p_high = 2131821171;
|
||||
public static final int jg_channel_name_p_low = 2131821172;
|
||||
public static final int jg_channel_name_p_min = 2131821173;
|
||||
public static final int kit_name = 2131821184;
|
||||
public static final int messenger_send_button_text = 2131821253;
|
||||
public static final int mtrl_chip_close_icon_content_description = 2131821290;
|
||||
public static final int number_limit = 2131821317;
|
||||
public static final int password_toggle_content_description = 2131821336;
|
||||
public static final int path_password_eye = 2131821337;
|
||||
public static final int path_password_eye_mask_strike_through = 2131821338;
|
||||
public static final int path_password_eye_mask_visible = 2131821339;
|
||||
public static final int path_password_strike_through = 2131821340;
|
||||
public static final int permission_app_name = 2131821341;
|
||||
public static final int permission_button_text_permission_denied_warning_dialog = 2131821342;
|
||||
public static final int permission_camera = 2131821343;
|
||||
public static final int permission_dialog_negative_btn_text = 2131821344;
|
||||
public static final int permission_location = 2131821345;
|
||||
public static final int permission_message_permission_denied = 2131821346;
|
||||
public static final int permission_message_permission_rationale = 2131821347;
|
||||
public static final int permission_name_calendar = 2131821348;
|
||||
public static final int permission_name_camera = 2131821349;
|
||||
public static final int permission_name_contacts = 2131821350;
|
||||
public static final int permission_name_location = 2131821351;
|
||||
public static final int permission_name_microphone = 2131821352;
|
||||
public static final int permission_name_phone = 2131821353;
|
||||
public static final int permission_name_sensors = 2131821354;
|
||||
public static final int permission_name_sms = 2131821355;
|
||||
public static final int permission_name_storage = 2131821356;
|
||||
public static final int permission_prompt_open_permission_by_settings = 2131821357;
|
||||
public static final int permission_prompt_open_permission_help = 2131821359;
|
||||
public static final int permission_record = 2131821360;
|
||||
public static final int permission_storage = 2131821361;
|
||||
public static final int permission_text_permission_denied_forever_positive_btn = 2131821362;
|
||||
public static final int permission_text_permission_rationale_positive_btn = 2131821363;
|
||||
public static final int permission_waring_text_bluetooth_enable_failed = 2131821364;
|
||||
public static final int please_add_photo = 2131821371;
|
||||
public static final int please_add_video = 2131821372;
|
||||
public static final int please_goto_setting_open_permission = 2131821376;
|
||||
public static final int rationale_permission_camera = 2131821450;
|
||||
public static final int rationale_permission_location = 2131821451;
|
||||
public static final int rationale_permission_mic = 2131821452;
|
||||
public static final int rationale_permission_storage = 2131821453;
|
||||
public static final int search_menu_title = 2131821508;
|
||||
public static final int status_bar_notification_info_overflow = 2131821607;
|
||||
public static final int tips_ask_camera_permission = 2131821642;
|
||||
public static final int tips_photo_or_video = 2131821657;
|
||||
public static final int tips_photo_or_video2 = 2131821658;
|
||||
public static final int tips_save_video_error = 2131821659;
|
||||
public static final int tips_type_limit = 2131821661;
|
||||
public static final int title_album = 2131821665;
|
||||
public static final int tw__allow_btn_txt = 2131821703;
|
||||
public static final int tw__composer_hint = 2131821704;
|
||||
public static final int tw__install = 2131821705;
|
||||
public static final int tw__like_tweet = 2131821706;
|
||||
public static final int tw__liked_tweet = 2131821707;
|
||||
public static final int tw__loading_tweet = 2131821708;
|
||||
public static final int tw__login_btn_txt = 2131821709;
|
||||
public static final int tw__max_tweet_chars = 2131821710;
|
||||
public static final int tw__not_now_btn_txt = 2131821711;
|
||||
public static final int tw__pause = 2131821712;
|
||||
public static final int tw__play = 2131821713;
|
||||
public static final int tw__play_store = 2131821714;
|
||||
public static final int tw__post_tweet = 2131821715;
|
||||
public static final int tw__relative_date_format_long = 2131821716;
|
||||
public static final int tw__relative_date_format_short = 2131821717;
|
||||
public static final int tw__replay = 2131821718;
|
||||
public static final int tw__retweeted_by_format = 2131821719;
|
||||
public static final int tw__share_content_format = 2131821720;
|
||||
public static final int tw__share_email_desc = 2131821721;
|
||||
public static final int tw__share_email_title = 2131821722;
|
||||
public static final int tw__share_subject_format = 2131821723;
|
||||
public static final int tw__share_tweet = 2131821724;
|
||||
public static final int tw__tweet_content_description = 2131821725;
|
||||
public static final int tw__tweet_media = 2131821726;
|
||||
public static final int unsupport_recording = 2131821738;
|
||||
}
|
159
sources/com/bottle/hp/album/Utils.java
Normal file
159
sources/com/bottle/hp/album/Utils.java
Normal file
@@ -0,0 +1,159 @@
|
||||
package com.bottle.hp.album;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.Time;
|
||||
import android.util.DisplayMetrics;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class Utils {
|
||||
public static String a() {
|
||||
Time time = new Time();
|
||||
time.setToNow();
|
||||
return "" + time.year + time.month + time.monthDay + "_" + time.hour + time.minute + time.second;
|
||||
}
|
||||
|
||||
public static int b(Context context) {
|
||||
new DisplayMetrics();
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
if (displayMetrics == null) {
|
||||
return 0;
|
||||
}
|
||||
return displayMetrics.widthPixels;
|
||||
}
|
||||
|
||||
public static boolean b(String str) {
|
||||
if (TextUtils.isEmpty(str)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return Pattern.compile("[0-9]{1,}").matcher(str).matches();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String a(long j) {
|
||||
long j2 = j / 1000;
|
||||
long j3 = j2 % 60;
|
||||
long j4 = (j2 / 60) % 60;
|
||||
long j5 = j2 / 3600;
|
||||
return j5 > 0 ? String.format("%d:%02d:%02d", Long.valueOf(j5), Long.valueOf(j4), Long.valueOf(j3)) : String.format("%02d:%02d", Long.valueOf(j4), Long.valueOf(j3));
|
||||
}
|
||||
|
||||
public static int a(Context context, float f) {
|
||||
return (int) ((f * context.getResources().getDisplayMetrics().density) + 0.5f);
|
||||
}
|
||||
|
||||
public static int a(Context context) {
|
||||
new DisplayMetrics();
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
if (displayMetrics == null) {
|
||||
return 0;
|
||||
}
|
||||
return displayMetrics.heightPixels;
|
||||
}
|
||||
|
||||
public static Bitmap a(ContentResolver contentResolver, String str, int i) {
|
||||
Cursor cursor;
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inDither = false;
|
||||
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
|
||||
try {
|
||||
cursor = contentResolver.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, new String[]{FileDownloadModel.ID}, "_data='" + str.replace("'", "''") + "'", null, null);
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
cursor = null;
|
||||
}
|
||||
if (cursor == null || cursor.getCount() == 0) {
|
||||
return null;
|
||||
}
|
||||
cursor.moveToFirst();
|
||||
String string = cursor.getString(cursor.getColumnIndex(FileDownloadModel.ID));
|
||||
if (string == null) {
|
||||
return null;
|
||||
}
|
||||
cursor.close();
|
||||
return MediaStore.Video.Thumbnails.getThumbnail(contentResolver, Long.parseLong(string), i, options);
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:13:0x001b, code lost:
|
||||
|
||||
if (r1 == null) goto L15;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x0022 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public static android.graphics.Bitmap a(java.lang.String r2) {
|
||||
/*
|
||||
r0 = 0
|
||||
android.media.MediaMetadataRetriever r1 = new android.media.MediaMetadataRetriever // Catch: java.lang.Throwable -> L13 java.lang.Exception -> L16
|
||||
r1.<init>() // Catch: java.lang.Throwable -> L13 java.lang.Exception -> L16
|
||||
r1.setDataSource(r2) // Catch: java.lang.Exception -> L11 java.lang.Throwable -> L1f
|
||||
android.graphics.Bitmap r0 = r1.getFrameAtTime() // Catch: java.lang.Exception -> L11 java.lang.Throwable -> L1f
|
||||
Ld:
|
||||
r1.release()
|
||||
goto L1e
|
||||
L11:
|
||||
r2 = move-exception
|
||||
goto L18
|
||||
L13:
|
||||
r2 = move-exception
|
||||
r1 = r0
|
||||
goto L20
|
||||
L16:
|
||||
r2 = move-exception
|
||||
r1 = r0
|
||||
L18:
|
||||
r2.printStackTrace() // Catch: java.lang.Throwable -> L1f
|
||||
if (r1 == 0) goto L1e
|
||||
goto Ld
|
||||
L1e:
|
||||
return r0
|
||||
L1f:
|
||||
r2 = move-exception
|
||||
L20:
|
||||
if (r1 == 0) goto L25
|
||||
r1.release()
|
||||
L25:
|
||||
throw r2
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.bottle.hp.album.Utils.a(java.lang.String):android.graphics.Bitmap");
|
||||
}
|
||||
|
||||
public static long a(File file) throws Exception {
|
||||
if (file.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
try {
|
||||
long available = fileInputStream.available();
|
||||
fileInputStream.close();
|
||||
return available;
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} catch (Throwable th2) {
|
||||
try {
|
||||
fileInputStream.close();
|
||||
} catch (Throwable th3) {
|
||||
th.addSuppressed(th3);
|
||||
}
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("文件不存在");
|
||||
return 0L;
|
||||
}
|
||||
}
|
389
sources/com/bottle/hp/album/capture/MediaPlayerActivity.java
Normal file
389
sources/com/bottle/hp/album/capture/MediaPlayerActivity.java
Normal file
@@ -0,0 +1,389 @@
|
||||
package com.bottle.hp.album.capture;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.baidu.cloud.media.player.IMediaPlayer;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.R$mipmap;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MediaPlayerActivity extends AppCompatActivity implements SurfaceHolder.Callback, MediaPlayer.OnCompletionListener, MediaPlayer.OnBufferingUpdateListener, MediaPlayer.OnErrorListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnInfoListener, View.OnClickListener {
|
||||
private ImageView b;
|
||||
private ImageView c;
|
||||
private SurfaceView d;
|
||||
private ImageView e;
|
||||
private TextView f;
|
||||
private ImageView g;
|
||||
private ProgressBar h;
|
||||
private View i;
|
||||
private TextView j;
|
||||
private MediaPlayer k;
|
||||
private SurfaceHolder l;
|
||||
private String m;
|
||||
private boolean n;
|
||||
private Handler x;
|
||||
private final String a = MediaPlayerActivity.class.getSimpleName();
|
||||
private int o = 0;
|
||||
private int p = 0;
|
||||
private boolean q = false;
|
||||
private boolean r = false;
|
||||
private boolean s = false;
|
||||
private boolean t = false;
|
||||
private boolean u = false;
|
||||
private Runnable v = new Runnable() { // from class: com.bottle.hp.album.capture.MediaPlayerActivity.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (MediaPlayerActivity.this.r) {
|
||||
try {
|
||||
MediaPlayerActivity.this.p = MediaPlayerActivity.this.k.getCurrentPosition();
|
||||
MediaPlayerActivity.this.a(1, null, MediaPlayerActivity.this.p, 0);
|
||||
MediaPlayerActivity.this.x.postDelayed(MediaPlayerActivity.this.v, 1000L);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static class StaticHandler extends Handler {
|
||||
private WeakReference<MediaPlayerActivity> a;
|
||||
|
||||
public StaticHandler(MediaPlayerActivity mediaPlayerActivity) {
|
||||
this.a = new WeakReference<>(mediaPlayerActivity);
|
||||
}
|
||||
|
||||
public WeakReference<MediaPlayerActivity> a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
if (message.what == 1 && a().get() != null) {
|
||||
a().get().l(message.arg1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void D0() {
|
||||
this.k = new MediaPlayer();
|
||||
this.k.setOnCompletionListener(this);
|
||||
this.k.setOnBufferingUpdateListener(this);
|
||||
this.k.setOnErrorListener(this);
|
||||
this.k.setOnPreparedListener(this);
|
||||
this.k.setOnInfoListener(this);
|
||||
this.k.setAudioStreamType(3);
|
||||
this.k.setDisplay(this.l);
|
||||
try {
|
||||
this.k.setDataSource(this.m);
|
||||
this.k.prepareAsync();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void E0() {
|
||||
try {
|
||||
if (this.k != null) {
|
||||
this.k.pause();
|
||||
this.r = false;
|
||||
this.c.setVisibility(0);
|
||||
this.e.setImageResource(R$mipmap.video_start);
|
||||
}
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void F0() {
|
||||
this.r = false;
|
||||
if (this.k != null) {
|
||||
new Thread(new Runnable() { // from class: com.bottle.hp.album.capture.MediaPlayerActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
MediaPlayerActivity.this.k.release();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
private void G0() {
|
||||
try {
|
||||
if (this.t) {
|
||||
this.t = false;
|
||||
this.k.seekTo(this.p);
|
||||
this.g.setVisibility(8);
|
||||
}
|
||||
if (!this.s) {
|
||||
this.k.start();
|
||||
}
|
||||
this.r = true;
|
||||
this.x.postDelayed(this.v, 200L);
|
||||
this.c.setVisibility(8);
|
||||
this.e.setImageResource(R$mipmap.video_stop);
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void c(View view) {
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
try {
|
||||
Intent intent = getIntent();
|
||||
this.m = intent.getStringExtra("uri");
|
||||
this.n = intent.getBooleanExtra("auto_close", false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void l(int i) {
|
||||
this.h.setProgress(i);
|
||||
int i2 = this.o - i;
|
||||
this.f.setText(String.format("%02d:%02d", Integer.valueOf(i2 / 1000000), Integer.valueOf(i2 / 1000)));
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
this.b = (ImageView) findViewById(R$id.activity_media_player_img_back);
|
||||
this.b.setOnClickListener(this);
|
||||
this.c = (ImageView) findViewById(R$id.activity_media_player_img_play);
|
||||
this.c.setOnClickListener(this);
|
||||
this.e = (ImageView) findViewById(R$id.activity_media_player_img_start);
|
||||
this.e.setOnClickListener(this);
|
||||
this.d = (SurfaceView) findViewById(R$id.activity_media_player_surface);
|
||||
this.f = (TextView) findViewById(R$id.activity_media_player_tv_reset);
|
||||
this.f.setOnClickListener(this);
|
||||
this.g = (ImageView) findViewById(R$id.activity_media_player_img_snagshot);
|
||||
this.h = (ProgressBar) findViewById(R$id.activity_media_player_pb);
|
||||
this.i = findViewById(R$id.rl_error);
|
||||
this.j = (TextView) findViewById(R$id.tv_retry);
|
||||
this.j.setOnClickListener(this);
|
||||
this.l = this.d.getHolder();
|
||||
this.l.addCallback(this);
|
||||
this.l.setFixedSize(320, 220);
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnBufferingUpdateListener
|
||||
public void onBufferingUpdate(MediaPlayer mediaPlayer, int i) {
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R$id.activity_media_player_img_back) {
|
||||
a(view);
|
||||
return;
|
||||
}
|
||||
if (id == R$id.tv_retry) {
|
||||
d(view);
|
||||
return;
|
||||
}
|
||||
if (id == R$id.activity_media_player_img_start) {
|
||||
e(view);
|
||||
} else if (id == R$id.activity_media_player_img_play) {
|
||||
b(view);
|
||||
} else if (id == R$id.activity_media_player_tv_reset) {
|
||||
c(view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnCompletionListener
|
||||
public void onCompletion(MediaPlayer mediaPlayer) {
|
||||
this.r = false;
|
||||
this.p = this.o;
|
||||
this.e.setImageResource(R$mipmap.video_start);
|
||||
a(1, null, this.o, 0);
|
||||
if (this.u) {
|
||||
this.u = false;
|
||||
} else {
|
||||
this.c.setVisibility(0);
|
||||
}
|
||||
try {
|
||||
if (this.n) {
|
||||
finish();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_media_player);
|
||||
this.x = new StaticHandler(this);
|
||||
initView();
|
||||
initData();
|
||||
if (bundle != null) {
|
||||
this.p = bundle.getInt("currentPosition");
|
||||
this.s = bundle.getBoolean("isPause");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onDestroy() {
|
||||
this.x.removeCallbacksAndMessages(null);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnErrorListener
|
||||
public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
|
||||
Log.e(this.a, "onError:" + i + "-" + i2);
|
||||
this.i.setVisibility(0);
|
||||
this.u = true;
|
||||
this.k.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnInfoListener
|
||||
public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
|
||||
Log.e(this.a, "onInfo:" + i + "-" + i2);
|
||||
if (i == -1004) {
|
||||
Log.e(this.a, "media error io");
|
||||
return false;
|
||||
}
|
||||
if (i == -110) {
|
||||
Log.e(this.a, "media error timeout");
|
||||
return false;
|
||||
}
|
||||
if (i == 1) {
|
||||
Log.i(this.a, "media info unknown");
|
||||
return false;
|
||||
}
|
||||
switch (i) {
|
||||
case IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING /* 700 */:
|
||||
Log.i(this.a, "media info video track lagging");
|
||||
break;
|
||||
case IMediaPlayer.MEDIA_INFO_BUFFERING_START /* 701 */:
|
||||
Log.i(this.a, "media info video buffering start");
|
||||
break;
|
||||
case IMediaPlayer.MEDIA_INFO_BUFFERING_END /* 702 */:
|
||||
Log.i(this.a, "media info buffering end");
|
||||
break;
|
||||
default:
|
||||
switch (i) {
|
||||
case 800:
|
||||
Log.i(this.a, "media info bad interleaving");
|
||||
break;
|
||||
case IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE /* 801 */:
|
||||
Log.i(this.a, "media info not seekable");
|
||||
break;
|
||||
case IMediaPlayer.MEDIA_INFO_METADATA_UPDATE /* 802 */:
|
||||
Log.i(this.a, "media info metadata update");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (i != 4) {
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
F0();
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onPause() {
|
||||
E0();
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnPreparedListener
|
||||
public void onPrepared(MediaPlayer mediaPlayer) {
|
||||
try {
|
||||
this.o = this.k.getDuration();
|
||||
this.h.setMax(this.o);
|
||||
this.q = true;
|
||||
this.r = true;
|
||||
G0();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onResume() {
|
||||
this.t = true;
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle bundle) {
|
||||
bundle.putInt("currentPosition", this.p);
|
||||
bundle.putBoolean("isPause", this.s);
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceCreated(SurfaceHolder surfaceHolder) {
|
||||
D0();
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
|
||||
}
|
||||
|
||||
private void d(View view) {
|
||||
this.i.setVisibility(8);
|
||||
try {
|
||||
this.k.reset();
|
||||
this.k.setDataSource(this.m);
|
||||
this.k.prepareAsync();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void e(View view) {
|
||||
MediaPlayer mediaPlayer = this.k;
|
||||
if (mediaPlayer != null && this.q) {
|
||||
if (mediaPlayer.isPlaying()) {
|
||||
this.s = true;
|
||||
E0();
|
||||
} else {
|
||||
this.s = false;
|
||||
G0();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void a(View view) {
|
||||
F0();
|
||||
finish();
|
||||
}
|
||||
|
||||
private void b(View view) {
|
||||
e((View) null);
|
||||
}
|
||||
|
||||
protected void a(int i, Object obj, int i2, int i3) {
|
||||
Handler handler = this.x;
|
||||
if (handler != null) {
|
||||
handler.sendMessage(handler.obtainMessage(i, i2, i3, obj));
|
||||
}
|
||||
}
|
||||
}
|
140
sources/com/bottle/hp/album/capture/PictureCaptureActivity.java
Normal file
140
sources/com/bottle/hp/album/capture/PictureCaptureActivity.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.bottle.hp.album.capture;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.hardware.Camera;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.capture.camera.CameraWrapper;
|
||||
import com.bottle.hp.album.capture.camera.NativeCamera;
|
||||
import com.bottle.hp.album.capture.preview.CapturePreview;
|
||||
import com.bottle.hp.album.capture.preview.CapturePreviewInterface;
|
||||
import com.bottle.hp.album.capture.view.IPictureCaptureListener;
|
||||
import com.bottle.hp.album.capture.view.PictureCaptureView;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PictureCaptureActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private String b;
|
||||
private PictureCaptureView c;
|
||||
private CameraWrapper d;
|
||||
private final String a = PictureCaptureActivity.class.getSimpleName();
|
||||
private Camera.PictureCallback e = new Camera.PictureCallback() { // from class: com.bottle.hp.album.capture.PictureCaptureActivity.3
|
||||
@Override // android.hardware.Camera.PictureCallback
|
||||
public void onPictureTaken(byte[] bArr, Camera camera) {
|
||||
File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + File.separator + "Jimu");
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
PictureCaptureActivity.this.b = file.getAbsolutePath() + File.separator + Utils.a() + ".png";
|
||||
File file2 = new File(PictureCaptureActivity.this.b);
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
try {
|
||||
try {
|
||||
FileOutputStream fileOutputStream2 = new FileOutputStream(file2);
|
||||
try {
|
||||
fileOutputStream2.write(bArr);
|
||||
PictureCaptureActivity.this.c.a(file2.getAbsolutePath());
|
||||
fileOutputStream2.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
e = e;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
ALog.a(PictureCaptureActivity.this.a).d("File not found: " + e.getMessage());
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
} catch (IOException e2) {
|
||||
e = e2;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
ALog.a(PictureCaptureActivity.this.a).d("Error accessing file: " + e.getMessage());
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
if (fileOutputStream != null) {
|
||||
try {
|
||||
fileOutputStream.close();
|
||||
} catch (Exception e3) {
|
||||
e3.printStackTrace();
|
||||
}
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
} catch (FileNotFoundException e4) {
|
||||
e = e4;
|
||||
} catch (IOException e5) {
|
||||
e = e5;
|
||||
}
|
||||
} catch (Exception e6) {
|
||||
e6.printStackTrace();
|
||||
}
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_picture_capture);
|
||||
this.c = (PictureCaptureView) findViewById(R$id.pictureCaptureView);
|
||||
this.c.setPictureCaptureListener(new IPictureCaptureListener() { // from class: com.bottle.hp.album.capture.PictureCaptureActivity.1
|
||||
@Override // com.bottle.hp.album.capture.view.IPictureCaptureListener
|
||||
public void a() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("data", PictureCaptureActivity.this.b);
|
||||
PictureCaptureActivity.this.setResult(-1, intent);
|
||||
PictureCaptureActivity.this.finish();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.IPictureCaptureListener
|
||||
public void b() {
|
||||
PictureCaptureActivity.this.d.a((Camera.ShutterCallback) null, (Camera.PictureCallback) null, PictureCaptureActivity.this.e);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.IPictureCaptureListener
|
||||
public void onCancel() {
|
||||
if (!TextUtils.isEmpty(PictureCaptureActivity.this.b)) {
|
||||
new File(PictureCaptureActivity.this.b).delete();
|
||||
PictureCaptureActivity.this.b = "";
|
||||
}
|
||||
PictureCaptureActivity.this.c.a();
|
||||
}
|
||||
});
|
||||
try {
|
||||
this.d = new CameraWrapper(new NativeCamera(), ((WindowManager) getSystemService("window")).getDefaultDisplay().getRotation(), 0, this);
|
||||
this.d.g();
|
||||
new CapturePreview(new CapturePreviewInterface() { // from class: com.bottle.hp.album.capture.PictureCaptureActivity.2
|
||||
@Override // com.bottle.hp.album.capture.preview.CapturePreviewInterface
|
||||
public void i() {
|
||||
PictureCaptureActivity.this.finish();
|
||||
}
|
||||
}, this.d, this.c.getPreviewSurfaceHolder());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
}
|
624
sources/com/bottle/hp/album/capture/VideoCaptureActivity.java
Normal file
624
sources/com/bottle/hp/album/capture/VideoCaptureActivity.java
Normal file
@@ -0,0 +1,624 @@
|
||||
package com.bottle.hp.album.capture;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.hardware.Camera;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.OrientationEventListener;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import com.bottle.hp.album.BaseActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.R$string;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.capture.camera.CameraWrapper;
|
||||
import com.bottle.hp.album.capture.camera.NativeCamera;
|
||||
import com.bottle.hp.album.capture.configuration.CaptureConfiguration;
|
||||
import com.bottle.hp.album.capture.configuration.PredefinedCaptureConfigurations$CaptureQuality;
|
||||
import com.bottle.hp.album.capture.configuration.PredefinedCaptureConfigurations$CaptureResolution;
|
||||
import com.bottle.hp.album.capture.preview.CapturePreviewInterface;
|
||||
import com.bottle.hp.album.capture.recorder.AlreadyUsedException;
|
||||
import com.bottle.hp.album.capture.recorder.VideoRecorder;
|
||||
import com.bottle.hp.album.capture.recorder.VideoRecorderInterface;
|
||||
import com.bottle.hp.album.capture.view.VideoCaptureView;
|
||||
import com.ubtech.permission.JimuPermissionRequest;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import com.yanzhenjie.permission.Permission$Group;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VideoCaptureActivity extends BaseActivity implements Camera.PictureCallback, CapturePreviewInterface, VideoCaptureView.IVideoCaptureUIListener, VideoRecorderInterface, View.OnClickListener, Camera.PreviewCallback {
|
||||
private static int y = 20000;
|
||||
private VideoCaptureView d;
|
||||
private CameraWrapper e;
|
||||
private String g;
|
||||
private Timer l;
|
||||
private CaptureConfiguration p;
|
||||
private VideoRecorder q;
|
||||
private AlbumOrientationEventListener s;
|
||||
private int t;
|
||||
private TimeCounter u;
|
||||
private final String c = VideoCaptureActivity.class.getSimpleName();
|
||||
private int f = 5;
|
||||
private boolean h = false;
|
||||
private long i = 0;
|
||||
private boolean j = false;
|
||||
private long k = 0;
|
||||
private Handler m = new Handler();
|
||||
private boolean n = false;
|
||||
private VideoFile o = null;
|
||||
private int r = 0;
|
||||
private int v = 100;
|
||||
private boolean x = false;
|
||||
|
||||
private class AlbumOrientationEventListener extends OrientationEventListener {
|
||||
public AlbumOrientationEventListener(Context context, int i) {
|
||||
super(context, i);
|
||||
}
|
||||
|
||||
@Override // android.view.OrientationEventListener
|
||||
public void onOrientationChanged(int i) {
|
||||
int i2;
|
||||
if (i == -1 || (i2 = (((i + 45) / 90) * 90) % 360) == VideoCaptureActivity.this.t) {
|
||||
return;
|
||||
}
|
||||
VideoCaptureActivity.this.t = i2;
|
||||
ALog.a(VideoCaptureActivity.this.c).d("角度" + VideoCaptureActivity.this.t);
|
||||
VideoCaptureActivity videoCaptureActivity = VideoCaptureActivity.this;
|
||||
videoCaptureActivity.l(videoCaptureActivity.t);
|
||||
}
|
||||
}
|
||||
|
||||
private class StartRecordTask extends TimerTask {
|
||||
private StartRecordTask() {
|
||||
}
|
||||
|
||||
@Override // java.util.TimerTask, java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
VideoCaptureActivity.this.x = false;
|
||||
VideoCaptureActivity.this.q.f();
|
||||
VideoCaptureActivity.this.m.postDelayed(new Runnable() { // from class: com.bottle.hp.album.capture.VideoCaptureActivity.StartRecordTask.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (VideoCaptureActivity.this.e.c() == null) {
|
||||
VideoCaptureActivity.this.b(R$string.tips_ask_camera_permission, 2);
|
||||
} else {
|
||||
VideoCaptureActivity.this.d.d();
|
||||
}
|
||||
}
|
||||
}, 10L);
|
||||
} catch (AlreadyUsedException unused) {
|
||||
ALog.a(VideoCaptureActivity.this.c).d("Cannot toggle recording after cleaning up all resources");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class TimeCounter extends CountDownTimer {
|
||||
private long a;
|
||||
|
||||
public TimeCounter(long j, long j2) {
|
||||
super(j, j2);
|
||||
this.a = 0L;
|
||||
}
|
||||
|
||||
public long a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.os.CountDownTimer
|
||||
public void onFinish() {
|
||||
VideoCaptureActivity.this.d.a(100);
|
||||
}
|
||||
|
||||
@Override // android.os.CountDownTimer
|
||||
public void onTick(long j) {
|
||||
int i = (int) (VideoCaptureActivity.y - j);
|
||||
this.a = i;
|
||||
VideoCaptureActivity.this.d.a((i * 100) / VideoCaptureActivity.y);
|
||||
}
|
||||
}
|
||||
|
||||
private void G0() {
|
||||
TimeCounter timeCounter = this.u;
|
||||
if (timeCounter != null) {
|
||||
timeCounter.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private File H0() {
|
||||
File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath() + File.separator + "Jimu");
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
this.g = file.getAbsolutePath() + File.separator + Utils.a() + ".png";
|
||||
return new File(this.g);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void I0() {
|
||||
try {
|
||||
if (this.q != null) {
|
||||
this.d.getPreviewSurfaceHolder().removeCallback(this.q.b());
|
||||
this.q.d();
|
||||
}
|
||||
this.e = new CameraWrapper(new NativeCamera(), ((WindowManager) getSystemService("window")).getDefaultDisplay().getRotation(), this.r, this);
|
||||
this.o = a((Bundle) null);
|
||||
this.q = new VideoRecorder(this, this.p, this.o, this.e, this.d.getPreviewSurfaceHolder());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(this.c, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void J0() {
|
||||
if (System.currentTimeMillis() - this.k < 1000) {
|
||||
return;
|
||||
}
|
||||
if (this.e.c() != null) {
|
||||
try {
|
||||
this.e.a((Camera.ShutterCallback) null, (Camera.PictureCallback) null, this);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(this.c, "拍照失败:" + e.getMessage());
|
||||
b(R$string.tips_ask_camera_permission, 2);
|
||||
}
|
||||
} else {
|
||||
Log.e(this.c, "camera 对象为空");
|
||||
b(R$string.tips_ask_camera_permission, 2);
|
||||
}
|
||||
this.k = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
private boolean K0() {
|
||||
TimeCounter timeCounter = this.u;
|
||||
if (timeCounter == null || timeCounter.a() >= 1500) {
|
||||
return false;
|
||||
}
|
||||
J0();
|
||||
VideoFile videoFile = this.o;
|
||||
if (videoFile != null && videoFile.a().exists()) {
|
||||
this.o.a().delete();
|
||||
sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(this.o.a())));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.d = (VideoCaptureView) findViewById(R$id.videoCaptureView);
|
||||
this.d.setUIListener(this);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void B0() {
|
||||
if (this.r == 0) {
|
||||
this.r = 1;
|
||||
} else {
|
||||
this.r = 0;
|
||||
}
|
||||
I0();
|
||||
}
|
||||
|
||||
protected CaptureConfiguration E0() {
|
||||
CaptureConfiguration captureConfiguration = (CaptureConfiguration) getIntent().getParcelableExtra("com.bottle.extracaptureconfiguration");
|
||||
if (captureConfiguration != null) {
|
||||
return captureConfiguration;
|
||||
}
|
||||
CaptureConfiguration captureConfiguration2 = new CaptureConfiguration();
|
||||
ALog.a(this.c).d("No captureconfiguration passed - using default configuration");
|
||||
return captureConfiguration2;
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.recorder.VideoRecorderInterface
|
||||
public void f0() {
|
||||
if (!this.j) {
|
||||
this.m.post(new Runnable() { // from class: com.bottle.hp.album.capture.VideoCaptureActivity.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoCaptureActivity.this.q.a("user cancel");
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.g = null;
|
||||
ALog.a(this.c).d("开始录制");
|
||||
this.m.postDelayed(new Runnable() { // from class: com.bottle.hp.album.capture.VideoCaptureActivity.4
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoCaptureActivity videoCaptureActivity = VideoCaptureActivity.this;
|
||||
videoCaptureActivity.u = videoCaptureActivity.new TimeCounter(VideoCaptureActivity.y, VideoCaptureActivity.this.v);
|
||||
VideoCaptureActivity.this.u.start();
|
||||
}
|
||||
}, 300L);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void h0() {
|
||||
this.j = true;
|
||||
if (this.f == 1) {
|
||||
return;
|
||||
}
|
||||
this.i = System.currentTimeMillis();
|
||||
this.l = new Timer();
|
||||
this.l.schedule(new StartRecordTask(), 300L);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.recorder.VideoRecorderInterface
|
||||
public boolean j0() {
|
||||
return JimuPermissionRequest.b(this, Permission$Group.c);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.recorder.VideoRecorderInterface
|
||||
public void l(String str) {
|
||||
ALog.a(this.c).d("停止录制");
|
||||
G0();
|
||||
if (this.x) {
|
||||
this.g = "";
|
||||
} else {
|
||||
if (K0()) {
|
||||
return;
|
||||
}
|
||||
onCancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.recorder.VideoRecorderInterface
|
||||
public void m(String str) {
|
||||
ALog.a(this.c).d("录制失败");
|
||||
G0();
|
||||
setResult(0);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (101 == i) {
|
||||
if (i2 == -1) {
|
||||
x0();
|
||||
} else {
|
||||
onCancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void onCancel() {
|
||||
VideoFile videoFile = this.o;
|
||||
if (videoFile != null && videoFile.a().exists()) {
|
||||
this.o.a().delete();
|
||||
sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(this.o.a())));
|
||||
}
|
||||
if (!TextUtils.isEmpty(this.g)) {
|
||||
File file = new File(this.g);
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(file)));
|
||||
}
|
||||
}
|
||||
this.m.postDelayed(new Runnable() { // from class: com.bottle.hp.album.capture.VideoCaptureActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoCaptureActivity.this.I0();
|
||||
}
|
||||
}, 10L);
|
||||
this.m.postDelayed(new Runnable() { // from class: com.bottle.hp.album.capture.VideoCaptureActivity.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoCaptureActivity.this.d.b();
|
||||
}
|
||||
}, 500L);
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_video_capture);
|
||||
c(bundle);
|
||||
initView();
|
||||
this.s = new AlbumOrientationEventListener(this, 3);
|
||||
if (this.s.canDetectOrientation()) {
|
||||
this.s.enable();
|
||||
} else {
|
||||
Log.e(this.c, "Can't Detect Orientation");
|
||||
}
|
||||
this.f = getIntent().getIntExtra("recordType", 5);
|
||||
int i = this.f;
|
||||
if (i == 1) {
|
||||
this.d.c();
|
||||
} else if (i == 2) {
|
||||
this.d.e();
|
||||
} else {
|
||||
this.d.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onDestroy() {
|
||||
Handler handler = this.m;
|
||||
if (handler != null) {
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
super.onDestroy();
|
||||
VideoRecorder videoRecorder = this.q;
|
||||
if (videoRecorder != null) {
|
||||
videoRecorder.d();
|
||||
}
|
||||
this.s.disable();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (this.j) {
|
||||
return true;
|
||||
}
|
||||
if (i != 4) {
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
setResult(0);
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override // android.hardware.Camera.PictureCallback
|
||||
public void onPictureTaken(byte[] bArr, Camera camera) {
|
||||
a(bArr);
|
||||
}
|
||||
|
||||
@Override // android.hardware.Camera.PreviewCallback
|
||||
public void onPreviewFrame(byte[] bArr, Camera camera) {
|
||||
if (bArr == null || bArr.length == 0) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
public void onSaveInstanceState(Bundle bundle) {
|
||||
bundle.putBoolean("com.bottle.savedrecordedboolean", this.n);
|
||||
bundle.putString("com.bottle.savedoutputfilename", this.o.b());
|
||||
super.onSaveInstanceState(bundle);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity, android.view.Window.Callback
|
||||
public void onWindowFocusChanged(boolean z) {
|
||||
super.onWindowFocusChanged(z);
|
||||
if (this.h) {
|
||||
return;
|
||||
}
|
||||
this.h = true;
|
||||
I0();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void r0() {
|
||||
this.j = false;
|
||||
if (this.f == 1) {
|
||||
J0();
|
||||
return;
|
||||
}
|
||||
this.l.cancel();
|
||||
if (System.currentTimeMillis() - this.i >= 300) {
|
||||
this.q.a("stop recoding");
|
||||
} else if (this.f == 5) {
|
||||
J0();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void t0() {
|
||||
Log.e("TestLog", "播放视频onPlayVideo");
|
||||
VideoPreviewActivity.a(this, 1001, this.o.b());
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.recorder.VideoRecorderInterface
|
||||
public void u0() {
|
||||
sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(this.o.a())));
|
||||
ALog.a(this.c).d("录制成功");
|
||||
this.x = true;
|
||||
if (this.u.a() < 1500) {
|
||||
this.x = false;
|
||||
} else {
|
||||
this.m.post(new Runnable() { // from class: com.bottle.hp.album.capture.VideoCaptureActivity.5
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoCaptureActivity videoCaptureActivity = VideoCaptureActivity.this;
|
||||
VideoPreviewActivity.a(videoCaptureActivity, 101, videoCaptureActivity.o.b());
|
||||
try {
|
||||
VideoCaptureActivity.this.e.j();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void x0() {
|
||||
Intent intent = new Intent();
|
||||
if (TextUtils.isEmpty(this.g)) {
|
||||
intent.putExtra("data", this.o.b());
|
||||
intent.putExtra("data_type", 1);
|
||||
} else {
|
||||
intent.putExtra("data", this.g);
|
||||
intent.putExtra("data_type", 0);
|
||||
}
|
||||
setResult(-1, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.view.VideoCaptureView.IVideoCaptureUIListener
|
||||
public void y0() {
|
||||
if (this.j) {
|
||||
return;
|
||||
}
|
||||
setResult(0);
|
||||
finish();
|
||||
}
|
||||
|
||||
public static CaptureConfiguration c(int i, int i2) {
|
||||
PredefinedCaptureConfigurations$CaptureResolution predefinedCaptureConfigurations$CaptureResolution = PredefinedCaptureConfigurations$CaptureResolution.RES_720P;
|
||||
PredefinedCaptureConfigurations$CaptureQuality predefinedCaptureConfigurations$CaptureQuality = PredefinedCaptureConfigurations$CaptureQuality.LOW;
|
||||
if (i2 != 1) {
|
||||
if (i2 == 2) {
|
||||
predefinedCaptureConfigurations$CaptureQuality = PredefinedCaptureConfigurations$CaptureQuality.MEDIUM;
|
||||
} else if (i2 == 3) {
|
||||
predefinedCaptureConfigurations$CaptureQuality = PredefinedCaptureConfigurations$CaptureQuality.HIGH;
|
||||
}
|
||||
}
|
||||
return new CaptureConfiguration(predefinedCaptureConfigurations$CaptureResolution, predefinedCaptureConfigurations$CaptureQuality, i, -1);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.preview.CapturePreviewInterface
|
||||
public void i() {
|
||||
finish();
|
||||
}
|
||||
|
||||
private boolean b(Bundle bundle) {
|
||||
if (bundle == null) {
|
||||
return false;
|
||||
}
|
||||
return bundle.getBoolean("com.bottle.savedrecordedboolean", false);
|
||||
}
|
||||
|
||||
public static void a(Activity activity, int i, int i2) {
|
||||
Intent intent = new Intent(activity, (Class<?>) VideoCaptureActivity.class);
|
||||
intent.putExtra("com.bottle.extracaptureconfiguration", c(y / 1000, 1));
|
||||
intent.putExtra("com.bottle.extraoutputfilename", "");
|
||||
intent.putExtra("recordType", i2);
|
||||
activity.startActivityForResult(intent, i);
|
||||
}
|
||||
|
||||
private void c(Bundle bundle) {
|
||||
this.p = E0();
|
||||
this.n = b(bundle);
|
||||
this.o = a(bundle);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void l(int i) {
|
||||
int i2;
|
||||
CameraWrapper cameraWrapper = this.e;
|
||||
if (cameraWrapper == null || cameraWrapper.c() == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Camera.Parameters parameters = this.e.c().getParameters();
|
||||
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
|
||||
Camera.getCameraInfo(this.r, cameraInfo);
|
||||
int i3 = ((i + 45) / 90) * 90;
|
||||
if (cameraInfo.facing == 1) {
|
||||
i2 = ((cameraInfo.orientation - i3) + 360) % 360;
|
||||
} else {
|
||||
i2 = (cameraInfo.orientation + i3) % 360;
|
||||
}
|
||||
parameters.setRotation(i2);
|
||||
this.e.c().setParameters(parameters);
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
Log.e(this.c, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:45:0x002e -> B:9:0x0079). Please report as a decompilation issue!!! */
|
||||
private void a(byte[] bArr) {
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
try {
|
||||
File H0 = H0();
|
||||
FileOutputStream fileOutputStream2 = new FileOutputStream(H0);
|
||||
try {
|
||||
fileOutputStream2.write(bArr);
|
||||
a(H0);
|
||||
fileOutputStream2.close();
|
||||
} catch (FileNotFoundException e2) {
|
||||
e = e2;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
e.printStackTrace();
|
||||
Log.e(this.c, "File not found: " + e.getMessage());
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
} catch (IOException e3) {
|
||||
e = e3;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
e.printStackTrace();
|
||||
Log.e(this.c, "Error accessing file: " + e.getMessage());
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
} catch (Exception e4) {
|
||||
e = e4;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
e.printStackTrace();
|
||||
if (fileOutputStream != null) {
|
||||
fileOutputStream.close();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
fileOutputStream = fileOutputStream2;
|
||||
if (fileOutputStream != null) {
|
||||
try {
|
||||
fileOutputStream.close();
|
||||
} catch (Exception e5) {
|
||||
e5.printStackTrace();
|
||||
}
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
} catch (FileNotFoundException e6) {
|
||||
e = e6;
|
||||
} catch (IOException e7) {
|
||||
e = e7;
|
||||
} catch (Exception e8) {
|
||||
e = e8;
|
||||
}
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
}
|
||||
}
|
||||
|
||||
private void a(File file) {
|
||||
try {
|
||||
sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(file)));
|
||||
this.e.j();
|
||||
this.d.a(file.getAbsolutePath(), 0);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(this.c, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
protected VideoFile a(Bundle bundle) {
|
||||
if (bundle != null) {
|
||||
return new VideoFile(bundle.getString("com.bottle.savedoutputfilename"));
|
||||
}
|
||||
return new VideoFile(getIntent().getStringExtra("com.bottle.extraoutputfilename"));
|
||||
}
|
||||
}
|
56
sources/com/bottle/hp/album/capture/VideoFile.java
Normal file
56
sources/com/bottle/hp/album/capture/VideoFile.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.bottle.hp.album.capture;
|
||||
|
||||
import android.os.Environment;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VideoFile {
|
||||
private final String a;
|
||||
private Date b;
|
||||
|
||||
public VideoFile(String str) {
|
||||
this.a = str;
|
||||
}
|
||||
|
||||
private String c() {
|
||||
if (e()) {
|
||||
return this.a;
|
||||
}
|
||||
return "video_" + new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(d()) + ".mp4";
|
||||
}
|
||||
|
||||
private Date d() {
|
||||
if (this.b == null) {
|
||||
this.b = new Date();
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
private boolean e() {
|
||||
if (this.a == null) {
|
||||
return false;
|
||||
}
|
||||
return !r0.isEmpty();
|
||||
}
|
||||
|
||||
public File a() {
|
||||
String c = c();
|
||||
if (c.contains("/")) {
|
||||
return new File(c);
|
||||
}
|
||||
File externalStoragePublicDirectory = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES);
|
||||
externalStoragePublicDirectory.mkdirs();
|
||||
return new File(externalStoragePublicDirectory, c());
|
||||
}
|
||||
|
||||
public String b() {
|
||||
return a().getAbsolutePath();
|
||||
}
|
||||
|
||||
public static String a(String str) {
|
||||
return str + File.separator + "video_" + new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date()) + ".mp4";
|
||||
}
|
||||
}
|
385
sources/com/bottle/hp/album/capture/VideoPlayFragment.java
Normal file
385
sources/com/bottle/hp/album/capture/VideoPlayFragment.java
Normal file
@@ -0,0 +1,385 @@
|
||||
package com.bottle.hp.album.capture;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.VideoView;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.ubt.jimu.base.mvp.SingleClickListener;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VideoPlayFragment extends Fragment implements MediaPlayer.OnCompletionListener, View.OnClickListener, View.OnTouchListener, MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener, MediaPlayer.OnInfoListener {
|
||||
private static StaticHandler s;
|
||||
private Uri b;
|
||||
private VideoView h;
|
||||
private ImageView i;
|
||||
private ProgressBar j;
|
||||
private TextView k;
|
||||
private TextView l;
|
||||
private RelativeLayout m;
|
||||
private int o;
|
||||
private IPlayListener p;
|
||||
private Timer q;
|
||||
private MediaPlayer.OnPreparedListener r;
|
||||
private final String a = VideoPlayFragment.class.getSimpleName();
|
||||
private boolean c = false;
|
||||
private boolean d = true;
|
||||
private boolean e = false;
|
||||
private boolean f = false;
|
||||
private ImageView.ScaleType g = ImageView.ScaleType.FIT_CENTER;
|
||||
private long n = 0;
|
||||
|
||||
public interface IPlayListener {
|
||||
void b(String str);
|
||||
|
||||
void m0();
|
||||
|
||||
void onFinished();
|
||||
|
||||
boolean onInfo(MediaPlayer mediaPlayer, int i, int i2);
|
||||
|
||||
void onProgress(int i, int i2, int i3);
|
||||
|
||||
void v0();
|
||||
}
|
||||
|
||||
private class ProgressTimerTask extends TimerTask {
|
||||
private ProgressTimerTask() {
|
||||
}
|
||||
|
||||
@Override // java.util.TimerTask, java.lang.Runnable
|
||||
public void run() {
|
||||
if (VideoPlayFragment.this.f) {
|
||||
return;
|
||||
}
|
||||
int currentPosition = VideoPlayFragment.this.h.getCurrentPosition();
|
||||
int duration = VideoPlayFragment.this.h.getDuration();
|
||||
if (duration <= 0) {
|
||||
return;
|
||||
}
|
||||
int i = (currentPosition * 100) / duration;
|
||||
VideoPlayFragment.this.o = currentPosition;
|
||||
VideoPlayFragment.s.sendMessage(VideoPlayFragment.s.obtainMessage(101, i, VideoPlayFragment.this.o, null));
|
||||
if (VideoPlayFragment.this.p != null) {
|
||||
VideoPlayFragment.this.p.onProgress(currentPosition, duration, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class StaticHandler extends Handler {
|
||||
private final WeakReference<VideoPlayFragment> a;
|
||||
|
||||
public StaticHandler(VideoPlayFragment videoPlayFragment) {
|
||||
this.a = new WeakReference<>(videoPlayFragment);
|
||||
}
|
||||
|
||||
public WeakReference<VideoPlayFragment> a() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // android.app.Fragment
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof IPlayListener) {
|
||||
this.p = (IPlayListener) context;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R$id.imgPlay) {
|
||||
b();
|
||||
} else if (id == R$id.video_view) {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnCompletionListener
|
||||
public void onCompletion(MediaPlayer mediaPlayer) {
|
||||
this.f = true;
|
||||
this.o = 0;
|
||||
if (this.d) {
|
||||
this.i.setVisibility(0);
|
||||
}
|
||||
Timer timer = this.q;
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
this.q = null;
|
||||
}
|
||||
StaticHandler staticHandler = s;
|
||||
staticHandler.sendMessage(staticHandler.obtainMessage(101, 100, this.h.getDuration(), null));
|
||||
IPlayListener iPlayListener = this.p;
|
||||
if (iPlayListener != null) {
|
||||
iPlayListener.onFinished();
|
||||
this.p.onProgress(this.h.getCurrentPosition(), this.h.getDuration(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
s = new StaticHandler(this, this) { // from class: com.bottle.hp.album.capture.VideoPlayFragment.1
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
if (message.what != 101 || a() == null || a().get() == null) {
|
||||
return;
|
||||
}
|
||||
a().get().a(message.arg1);
|
||||
}
|
||||
};
|
||||
new Thread();
|
||||
if (getArguments() != null) {
|
||||
this.b = (Uri) getArguments().getParcelable("url");
|
||||
this.c = getArguments().getBoolean("auto");
|
||||
this.d = getArguments().getBoolean("show_ui", true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
|
||||
View inflate = layoutInflater.inflate(R$layout.video_play_fragment, (ViewGroup) null, false);
|
||||
this.k = (TextView) inflate.findViewById(R$id.tvCurrent);
|
||||
this.l = (TextView) inflate.findViewById(R$id.tvDuration);
|
||||
this.m = (RelativeLayout) inflate.findViewById(R$id.rlProgress);
|
||||
this.h = (VideoView) inflate.findViewById(R$id.video_view);
|
||||
this.h.setOnCompletionListener(this);
|
||||
this.h.setOnTouchListener(this);
|
||||
this.h.setOnPreparedListener(this);
|
||||
this.h.setOnErrorListener(this);
|
||||
if (Build.VERSION.SDK_INT >= 17) {
|
||||
this.h.setOnInfoListener(this);
|
||||
}
|
||||
this.i = (ImageView) inflate.findViewById(R$id.imgPlay);
|
||||
this.i.setOnClickListener(this);
|
||||
this.j = (ProgressBar) inflate.findViewById(R$id.progressBar);
|
||||
if (!this.d) {
|
||||
this.m.setVisibility(4);
|
||||
this.i.setVisibility(8);
|
||||
}
|
||||
try {
|
||||
if (this.b != null) {
|
||||
this.h.setVideoURI(this.b);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
a(e.getMessage());
|
||||
}
|
||||
if (this.c) {
|
||||
b();
|
||||
}
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
s.removeCallbacksAndMessages(null);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
Timer timer = this.q;
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnErrorListener
|
||||
public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
|
||||
a("msg:" + i2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnInfoListener
|
||||
public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
|
||||
ALog.a(this.a).d("what:" + i + " extra " + i2);
|
||||
IPlayListener iPlayListener = this.p;
|
||||
if (iPlayListener == null) {
|
||||
return false;
|
||||
}
|
||||
iPlayListener.onInfo(mediaPlayer, i, i2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
this.e = true;
|
||||
}
|
||||
|
||||
@Override // android.media.MediaPlayer.OnPreparedListener
|
||||
public void onPrepared(MediaPlayer mediaPlayer) {
|
||||
int b = Utils.b(getActivity());
|
||||
int a = Utils.a(getActivity());
|
||||
int videoWidth = mediaPlayer.getVideoWidth();
|
||||
int videoHeight = mediaPlayer.getVideoHeight();
|
||||
if (ImageView.ScaleType.FIT_CENTER == this.g) {
|
||||
if (b > a) {
|
||||
b = (videoWidth * a) / videoHeight;
|
||||
} else {
|
||||
a = (videoHeight * b) / videoWidth;
|
||||
}
|
||||
} else if (b <= a) {
|
||||
a = (videoHeight * b) / videoWidth;
|
||||
} else if (videoWidth > videoHeight) {
|
||||
a = (videoHeight * b) / videoWidth;
|
||||
} else {
|
||||
b = (videoWidth * a) / videoHeight;
|
||||
}
|
||||
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(b, a);
|
||||
layoutParams.gravity = 17;
|
||||
this.h.setLayoutParams(layoutParams);
|
||||
MediaPlayer.OnPreparedListener onPreparedListener = this.r;
|
||||
if (onPreparedListener != null) {
|
||||
onPreparedListener.onPrepared(mediaPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnTouchListener
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
int action = motionEvent.getAction();
|
||||
if (action == 0) {
|
||||
this.n = System.currentTimeMillis();
|
||||
ALog.a(this.a).d("action down");
|
||||
return true;
|
||||
}
|
||||
if (action == 1) {
|
||||
e();
|
||||
return true;
|
||||
}
|
||||
if (action != 2) {
|
||||
return false;
|
||||
}
|
||||
ALog.a(this.a).d("action move");
|
||||
return false;
|
||||
}
|
||||
|
||||
private void e() {
|
||||
if (System.currentTimeMillis() - this.n > 500) {
|
||||
return;
|
||||
}
|
||||
if (this.h.isPlaying()) {
|
||||
a();
|
||||
} else {
|
||||
b();
|
||||
}
|
||||
ALog.a(this.a).d("action up");
|
||||
}
|
||||
|
||||
public void c() {
|
||||
a(this.o, true);
|
||||
}
|
||||
|
||||
public static VideoPlayFragment a(Uri uri, boolean z, boolean z2) {
|
||||
VideoPlayFragment videoPlayFragment = new VideoPlayFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("url", uri);
|
||||
bundle.putBoolean("auto", z);
|
||||
bundle.putBoolean("show_ui", z2);
|
||||
videoPlayFragment.setArguments(bundle);
|
||||
return videoPlayFragment;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
if (this.e) {
|
||||
a(this.o, true);
|
||||
} else {
|
||||
a(this.o, false);
|
||||
}
|
||||
this.e = false;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(int i) {
|
||||
this.j.setProgress(i);
|
||||
this.k.setText(Utils.a(this.h.getCurrentPosition()));
|
||||
this.l.setText(Utils.a(this.h.getDuration() + SingleClickListener.FAST_CLICK_DELAY_TIME));
|
||||
if (i == 100) {
|
||||
this.k.setText(Utils.a(this.h.getDuration() + SingleClickListener.FAST_CLICK_DELAY_TIME));
|
||||
}
|
||||
}
|
||||
|
||||
private void a(int i, boolean z) {
|
||||
if (z && !this.f) {
|
||||
this.h.seekTo(i);
|
||||
}
|
||||
this.f = false;
|
||||
this.h.start();
|
||||
this.q = new Timer();
|
||||
this.q.schedule(new ProgressTimerTask(), 10L, 300L);
|
||||
this.i.setVisibility(8);
|
||||
IPlayListener iPlayListener = this.p;
|
||||
if (iPlayListener != null) {
|
||||
iPlayListener.v0();
|
||||
}
|
||||
}
|
||||
|
||||
private void a(String str) {
|
||||
this.i.post(new Runnable() { // from class: com.bottle.hp.album.capture.VideoPlayFragment.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoPlayFragment.this.i.setVisibility(4);
|
||||
}
|
||||
});
|
||||
IPlayListener iPlayListener = this.p;
|
||||
if (iPlayListener != null) {
|
||||
iPlayListener.b(str);
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Uri uri) {
|
||||
if (uri == null) {
|
||||
a("播放地址为null");
|
||||
return;
|
||||
}
|
||||
Uri uri2 = this.b;
|
||||
if (uri2 == null || !uri2.equals(uri)) {
|
||||
this.b = uri;
|
||||
this.h.setVideoURI(uri);
|
||||
this.o = 0;
|
||||
this.l.setText(Utils.a(this.h.getDuration() + SingleClickListener.FAST_CLICK_DELAY_TIME));
|
||||
this.k.setText(Utils.a(0L));
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.o = this.h.getCurrentPosition();
|
||||
if (this.d) {
|
||||
this.i.setVisibility(0);
|
||||
}
|
||||
this.h.pause();
|
||||
Timer timer = this.q;
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
this.q = null;
|
||||
}
|
||||
IPlayListener iPlayListener = this.p;
|
||||
if (iPlayListener != null) {
|
||||
iPlayListener.m0();
|
||||
}
|
||||
}
|
||||
}
|
141
sources/com/bottle/hp/album/capture/VideoPreviewActivity.java
Normal file
141
sources/com/bottle/hp/album/capture/VideoPreviewActivity.java
Normal file
@@ -0,0 +1,141 @@
|
||||
package com.bottle.hp.album.capture;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import com.bottle.hp.album.BaseActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.capture.VideoPlayFragment;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.io.File;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VideoPreviewActivity extends BaseActivity implements View.OnClickListener, VideoPlayFragment.IPlayListener {
|
||||
private static final String i = VideoPreviewActivity.class.getSimpleName();
|
||||
private VideoPlayFragment c;
|
||||
private FrameLayout d;
|
||||
private ImageView e;
|
||||
private ImageView f;
|
||||
private String g;
|
||||
private boolean h = true;
|
||||
|
||||
private void c(int i2, String str) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("url", str);
|
||||
setResult(i2, intent);
|
||||
this.c.a();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void b(String str) {
|
||||
long j;
|
||||
Log.e(i, str);
|
||||
File file = new File(this.g);
|
||||
try {
|
||||
j = Utils.a(file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(i, e.getMessage());
|
||||
j = 0;
|
||||
}
|
||||
if (!file.exists() || j == 0) {
|
||||
this.f.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void m0() {
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (R$id.imgCancel == view.getId()) {
|
||||
c(0, this.g);
|
||||
} else if (R$id.imgAccept == view.getId()) {
|
||||
c(-1, this.g);
|
||||
} else {
|
||||
ALog.a(i).d("click");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_video_preview);
|
||||
this.d = (FrameLayout) findViewById(R$id.flVideoViewContainer);
|
||||
this.e = (ImageView) findViewById(R$id.imgCancel);
|
||||
this.f = (ImageView) findViewById(R$id.imgAccept);
|
||||
this.e.setOnClickListener(this);
|
||||
this.f.setOnClickListener(this);
|
||||
this.g = getIntent().getStringExtra("url");
|
||||
this.c = VideoPlayFragment.a(Uri.parse(this.g), true, true);
|
||||
getFragmentManager().beginTransaction().replace(R$id.flVideoViewContainer, this.c).commit();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void onFinished() {
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public boolean onInfo(MediaPlayer mediaPlayer, int i2, int i3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
|
||||
if (i2 != 4) {
|
||||
return super.onKeyDown(i2, keyEvent);
|
||||
}
|
||||
c(0, this.g);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
VideoPlayFragment videoPlayFragment = this.c;
|
||||
if (videoPlayFragment != null) {
|
||||
videoPlayFragment.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void onProgress(int i2, int i3, int i4) {
|
||||
Log.e(i, "progress:" + i4);
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (this.h) {
|
||||
this.h = false;
|
||||
} else {
|
||||
this.d.post(new Runnable() { // from class: com.bottle.hp.album.capture.VideoPreviewActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
VideoPreviewActivity.this.c.c();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void v0() {
|
||||
}
|
||||
|
||||
public static void a(Activity activity, int i2, String str) {
|
||||
Intent intent = new Intent(activity, (Class<?>) VideoPreviewActivity.class);
|
||||
intent.putExtra("url", str);
|
||||
activity.startActivityForResult(intent, i2);
|
||||
}
|
||||
}
|
20
sources/com/bottle/hp/album/capture/camera/CameraSize.java
Normal file
20
sources/com/bottle/hp/album/capture/camera/CameraSize.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.bottle.hp.album.capture.camera;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CameraSize {
|
||||
private final int a;
|
||||
private final int b;
|
||||
|
||||
public CameraSize(int i, int i2) {
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public int b() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
216
sources/com/bottle/hp/album/capture/camera/CameraWrapper.java
Normal file
216
sources/com/bottle/hp/album/capture/camera/CameraWrapper.java
Normal file
@@ -0,0 +1,216 @@
|
||||
package com.bottle.hp.album.capture.camera;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.hardware.Camera;
|
||||
import android.media.CamcorderProfile;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.capture.camera.OpenCameraException;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CameraWrapper {
|
||||
private final int b;
|
||||
private NativeCamera c;
|
||||
private int e;
|
||||
private Context f;
|
||||
private final String a = CameraWrapper.class.getSimpleName();
|
||||
private Camera.Parameters d = null;
|
||||
|
||||
public CameraWrapper(NativeCamera nativeCamera, int i, int i2, Context context) {
|
||||
this.c = null;
|
||||
this.c = nativeCamera;
|
||||
this.b = i;
|
||||
this.e = i2;
|
||||
this.f = context;
|
||||
}
|
||||
|
||||
private CamcorderProfile k() {
|
||||
CamcorderProfile camcorderProfile = CamcorderProfile.get(1);
|
||||
if (camcorderProfile != null) {
|
||||
return camcorderProfile;
|
||||
}
|
||||
CamcorderProfile camcorderProfile2 = CamcorderProfile.get(0);
|
||||
if (camcorderProfile2 != null) {
|
||||
return camcorderProfile2;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void a(SurfaceHolder surfaceHolder) throws IOException {
|
||||
this.c.a(surfaceHolder);
|
||||
this.c.f();
|
||||
}
|
||||
|
||||
public RecordingSize b(int i, int i2) {
|
||||
CameraSize a = a(a(Build.VERSION.SDK_INT), i, i2);
|
||||
if (a == null) {
|
||||
ALog.a(this.a).d("Failed to find supported recording size - falling back to requested: " + i + "x" + i2);
|
||||
return new RecordingSize(i, i2);
|
||||
}
|
||||
ALog.a(this.a).d("Recording size: " + a.b() + "x" + a.a());
|
||||
return new RecordingSize(a.b(), a.a());
|
||||
}
|
||||
|
||||
public Camera c() {
|
||||
return this.c.c();
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int e() {
|
||||
return ((this.c.b() - (this.b * 90)) + 360) % 360;
|
||||
}
|
||||
|
||||
public Camera.Size f() {
|
||||
List<Camera.Size> supportedPictureSizes;
|
||||
this.d = this.c.d();
|
||||
Camera.Parameters parameters = this.d;
|
||||
if (parameters == null || (supportedPictureSizes = parameters.getSupportedPictureSizes()) == null || supportedPictureSizes.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
int b = Utils.b(this.f);
|
||||
int a = Utils.a(this.f);
|
||||
if (a < b) {
|
||||
b = a;
|
||||
}
|
||||
int i = 0;
|
||||
while (true) {
|
||||
if (i >= supportedPictureSizes.size()) {
|
||||
i = -1;
|
||||
break;
|
||||
}
|
||||
if (b == supportedPictureSizes.get(i).height) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (i == -1) {
|
||||
i = supportedPictureSizes.size() / 2;
|
||||
}
|
||||
return supportedPictureSizes.get(i);
|
||||
}
|
||||
|
||||
public void g() throws OpenCameraException {
|
||||
try {
|
||||
this.c.a(this.e);
|
||||
if (this.c.c() == null) {
|
||||
throw new OpenCameraException(OpenCameraException.OpenType.NOCAMERA);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
throw new OpenCameraException(OpenCameraException.OpenType.INUSE);
|
||||
}
|
||||
}
|
||||
|
||||
public void h() throws PrepareCameraException {
|
||||
try {
|
||||
this.c.h();
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
throw new PrepareCameraException();
|
||||
}
|
||||
}
|
||||
|
||||
public void i() {
|
||||
if (c() == null) {
|
||||
return;
|
||||
}
|
||||
this.c.e();
|
||||
}
|
||||
|
||||
public void j() throws Exception {
|
||||
this.c.g();
|
||||
this.c.a();
|
||||
}
|
||||
|
||||
public void a(int i, int i2) {
|
||||
if (i == 0) {
|
||||
i = Utils.b(this.f);
|
||||
}
|
||||
if (i2 == 0) {
|
||||
i2 = Utils.a(this.f);
|
||||
}
|
||||
Camera.Parameters d = this.c.d();
|
||||
CameraSize a = a(d.getSupportedPreviewSizes(), i, i2);
|
||||
Camera.Size f = f();
|
||||
d.setPreviewSize(a.b(), a.a());
|
||||
d.setPictureSize(f == null ? a.b() : f.width, f == null ? a.a() : f.height);
|
||||
d.setPreviewFormat(17);
|
||||
this.c.a(d);
|
||||
this.c.b(d());
|
||||
ALog.a(this.a).d("Preview size: " + a.b() + "x" + a.a());
|
||||
}
|
||||
|
||||
public CamcorderProfile b() {
|
||||
if (Build.VERSION.SDK_INT < 11) {
|
||||
return k();
|
||||
}
|
||||
if (CamcorderProfile.hasProfile(5)) {
|
||||
return CamcorderProfile.get(5);
|
||||
}
|
||||
if (CamcorderProfile.hasProfile(4)) {
|
||||
return CamcorderProfile.get(4);
|
||||
}
|
||||
return k();
|
||||
}
|
||||
|
||||
public void a() {
|
||||
Camera.Parameters d = this.c.d();
|
||||
d.setFocusMode("continuous-video");
|
||||
this.c.a(d);
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
protected List<Camera.Size> a(int i) {
|
||||
Camera.Parameters d = this.c.d();
|
||||
if (i < 11) {
|
||||
Log.e(this.a, "Using supportedPreviewSizes iso supportedVideoSizes due to API restriction");
|
||||
return d.getSupportedPreviewSizes();
|
||||
}
|
||||
if (d.getSupportedVideoSizes() == null) {
|
||||
Log.e(this.a, "Using supportedPreviewSizes because supportedVideoSizes is null");
|
||||
return d.getSupportedPreviewSizes();
|
||||
}
|
||||
return d.getSupportedVideoSizes();
|
||||
}
|
||||
|
||||
public CameraSize a(List<Camera.Size> list, int i, int i2) {
|
||||
double d = i / i2;
|
||||
Camera.Size size = null;
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
double d2 = Double.MAX_VALUE;
|
||||
double d3 = Double.MAX_VALUE;
|
||||
for (Camera.Size size2 : list) {
|
||||
if (Math.abs((size2.width / size2.height) - d) <= 0.1d && Math.abs(size2.height - i2) < d3) {
|
||||
d3 = Math.abs(size2.height - i2);
|
||||
size = size2;
|
||||
}
|
||||
}
|
||||
if (size == null) {
|
||||
for (Camera.Size size3 : list) {
|
||||
if (Math.abs(size3.height - i2) < d2) {
|
||||
size = size3;
|
||||
d2 = Math.abs(size3.height - i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (size != null) {
|
||||
return new CameraSize(size.width, size.height);
|
||||
}
|
||||
return new CameraSize(0, 0);
|
||||
}
|
||||
|
||||
public void a(Camera.ShutterCallback shutterCallback, Camera.PictureCallback pictureCallback, Camera.PictureCallback pictureCallback2) {
|
||||
c().takePicture(shutterCallback, pictureCallback, pictureCallback2);
|
||||
}
|
||||
}
|
77
sources/com/bottle/hp/album/capture/camera/NativeCamera.java
Normal file
77
sources/com/bottle/hp/album/capture/camera/NativeCamera.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.bottle.hp.album.capture.camera;
|
||||
|
||||
import android.hardware.Camera;
|
||||
import android.view.SurfaceHolder;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class NativeCamera {
|
||||
private Camera a = null;
|
||||
private Camera.Parameters b = null;
|
||||
|
||||
private int i() {
|
||||
int numberOfCameras = Camera.getNumberOfCameras();
|
||||
for (int i = 0; i < numberOfCameras; i++) {
|
||||
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
|
||||
Camera.getCameraInfo(i, cameraInfo);
|
||||
if (cameraInfo.facing == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void a(int i) throws RuntimeException {
|
||||
this.a = Camera.open(i);
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
this.a.setDisplayOrientation(i);
|
||||
}
|
||||
|
||||
public Camera c() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public Camera.Parameters d() {
|
||||
if (this.b == null) {
|
||||
this.b = this.a.getParameters();
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public void e() {
|
||||
this.a.release();
|
||||
}
|
||||
|
||||
public void f() {
|
||||
this.a.startPreview();
|
||||
}
|
||||
|
||||
public void g() {
|
||||
this.a.stopPreview();
|
||||
}
|
||||
|
||||
public void h() {
|
||||
this.a.unlock();
|
||||
}
|
||||
|
||||
public void a(SurfaceHolder surfaceHolder) throws IOException {
|
||||
this.a.setPreviewDisplay(surfaceHolder);
|
||||
}
|
||||
|
||||
public int b() {
|
||||
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
|
||||
Camera.getCameraInfo(i(), cameraInfo);
|
||||
return cameraInfo.orientation;
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.a.setPreviewCallback(null);
|
||||
}
|
||||
|
||||
public void a(Camera.Parameters parameters) {
|
||||
this.b = parameters;
|
||||
this.a.setParameters(parameters);
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.bottle.hp.album.capture.camera;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class OpenCameraException extends Exception {
|
||||
private static final String LOG_PREFIX = "Unable to open camera - ";
|
||||
private static final long serialVersionUID = -7340415176385044242L;
|
||||
private final String TAG;
|
||||
private final OpenType mType;
|
||||
|
||||
public enum OpenType {
|
||||
INUSE("Camera disabled or in use by other process"),
|
||||
NOCAMERA("Device does not have camera");
|
||||
|
||||
private String mMessage;
|
||||
|
||||
OpenType(String str) {
|
||||
this.mMessage = str;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.mMessage;
|
||||
}
|
||||
}
|
||||
|
||||
public OpenCameraException(OpenType openType) {
|
||||
super(openType.getMessage());
|
||||
this.TAG = OpenCameraException.class.getSimpleName();
|
||||
this.mType = openType;
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public void printStackTrace() {
|
||||
Log.e(this.TAG, LOG_PREFIX + this.mType.getMessage());
|
||||
super.printStackTrace();
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.bottle.hp.album.capture.camera;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PrepareCameraException extends Exception {
|
||||
private static final String LOG_PREFIX = "Unable to unlock camera - ";
|
||||
private static final String MESSAGE = "Unable to use camera for recording";
|
||||
private static final long serialVersionUID = 6305923762266448674L;
|
||||
private final String TAG = PrepareCameraException.class.getSimpleName();
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getMessage() {
|
||||
Log.e(this.TAG, "Unable to unlock camera - Unable to use camera for recording");
|
||||
return MESSAGE;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.bottle.hp.album.capture.camera;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class RecordingSize {
|
||||
public int a;
|
||||
public int b;
|
||||
|
||||
public RecordingSize(int i, int i2) {
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
}
|
||||
}
|
@@ -0,0 +1,174 @@
|
||||
package com.bottle.hp.album.capture.configuration;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CaptureConfiguration implements Parcelable {
|
||||
public static final Parcelable.Creator<CaptureConfiguration> CREATOR = new Parcelable.Creator<CaptureConfiguration>() { // from class: com.bottle.hp.album.capture.configuration.CaptureConfiguration.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public CaptureConfiguration createFromParcel(Parcel parcel) {
|
||||
return new CaptureConfiguration(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public CaptureConfiguration[] newArray(int i) {
|
||||
return new CaptureConfiguration[i];
|
||||
}
|
||||
};
|
||||
private static final int MBYTE_TO_BYTE = 1048576;
|
||||
private static final int MSEC_TO_SEC = 1000;
|
||||
public static final int NO_DURATION_LIMIT = -1;
|
||||
public static final int NO_FILESIZE_LIMIT = -1;
|
||||
private int AUDIO_ENCODER;
|
||||
private int AUDIO_SOURCE;
|
||||
private int OUTPUT_FORMAT;
|
||||
private int VIDEO_ENCODER;
|
||||
private int VIDEO_SOURCE;
|
||||
private int mBitrate;
|
||||
private int mMaxDurationMs;
|
||||
private int mMaxFilesizeBytes;
|
||||
private int mVideoHeight;
|
||||
private int mVideoWidth;
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getAudioEncoder() {
|
||||
return this.AUDIO_ENCODER;
|
||||
}
|
||||
|
||||
public int getAudioSource() {
|
||||
return this.AUDIO_SOURCE;
|
||||
}
|
||||
|
||||
public int getMaxCaptureDuration() {
|
||||
return this.mMaxDurationMs;
|
||||
}
|
||||
|
||||
public int getMaxCaptureFileSize() {
|
||||
return this.mMaxFilesizeBytes;
|
||||
}
|
||||
|
||||
public int getOutputFormat() {
|
||||
return this.OUTPUT_FORMAT;
|
||||
}
|
||||
|
||||
public int getVideoBitrate() {
|
||||
return this.mBitrate;
|
||||
}
|
||||
|
||||
public int getVideoEncoder() {
|
||||
return this.VIDEO_ENCODER;
|
||||
}
|
||||
|
||||
public int getVideoHeight() {
|
||||
return this.mVideoHeight;
|
||||
}
|
||||
|
||||
public int getVideoSource() {
|
||||
return this.VIDEO_SOURCE;
|
||||
}
|
||||
|
||||
public int getVideoWidth() {
|
||||
return this.mVideoWidth;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeInt(this.mVideoWidth);
|
||||
parcel.writeInt(this.mVideoHeight);
|
||||
parcel.writeInt(this.mBitrate);
|
||||
parcel.writeInt(this.mMaxDurationMs);
|
||||
parcel.writeInt(this.mMaxFilesizeBytes);
|
||||
parcel.writeInt(this.OUTPUT_FORMAT);
|
||||
parcel.writeInt(this.AUDIO_SOURCE);
|
||||
parcel.writeInt(this.AUDIO_ENCODER);
|
||||
parcel.writeInt(this.VIDEO_SOURCE);
|
||||
parcel.writeInt(this.VIDEO_ENCODER);
|
||||
}
|
||||
|
||||
public CaptureConfiguration() {
|
||||
this.mVideoWidth = 1280;
|
||||
this.mVideoHeight = 720;
|
||||
this.mBitrate = 5000000;
|
||||
this.mMaxDurationMs = -1;
|
||||
this.mMaxFilesizeBytes = -1;
|
||||
this.OUTPUT_FORMAT = 2;
|
||||
this.AUDIO_SOURCE = 0;
|
||||
this.AUDIO_ENCODER = 3;
|
||||
this.VIDEO_SOURCE = 1;
|
||||
this.VIDEO_ENCODER = 2;
|
||||
}
|
||||
|
||||
public CaptureConfiguration(PredefinedCaptureConfigurations$CaptureResolution predefinedCaptureConfigurations$CaptureResolution, PredefinedCaptureConfigurations$CaptureQuality predefinedCaptureConfigurations$CaptureQuality) {
|
||||
this.mVideoWidth = 1280;
|
||||
this.mVideoHeight = 720;
|
||||
this.mBitrate = 5000000;
|
||||
this.mMaxDurationMs = -1;
|
||||
this.mMaxFilesizeBytes = -1;
|
||||
this.OUTPUT_FORMAT = 2;
|
||||
this.AUDIO_SOURCE = 0;
|
||||
this.AUDIO_ENCODER = 3;
|
||||
this.VIDEO_SOURCE = 1;
|
||||
this.VIDEO_ENCODER = 2;
|
||||
this.mVideoWidth = predefinedCaptureConfigurations$CaptureResolution.width;
|
||||
this.mVideoHeight = predefinedCaptureConfigurations$CaptureResolution.height;
|
||||
this.mBitrate = predefinedCaptureConfigurations$CaptureResolution.getBitrate(predefinedCaptureConfigurations$CaptureQuality);
|
||||
}
|
||||
|
||||
public CaptureConfiguration(PredefinedCaptureConfigurations$CaptureResolution predefinedCaptureConfigurations$CaptureResolution, PredefinedCaptureConfigurations$CaptureQuality predefinedCaptureConfigurations$CaptureQuality, int i, int i2) {
|
||||
this(predefinedCaptureConfigurations$CaptureResolution, predefinedCaptureConfigurations$CaptureQuality);
|
||||
this.mMaxDurationMs = i * MSEC_TO_SEC;
|
||||
this.mMaxFilesizeBytes = i2 * MBYTE_TO_BYTE;
|
||||
}
|
||||
|
||||
public CaptureConfiguration(int i, int i2, int i3) {
|
||||
this.mVideoWidth = 1280;
|
||||
this.mVideoHeight = 720;
|
||||
this.mBitrate = 5000000;
|
||||
this.mMaxDurationMs = -1;
|
||||
this.mMaxFilesizeBytes = -1;
|
||||
this.OUTPUT_FORMAT = 2;
|
||||
this.AUDIO_SOURCE = 0;
|
||||
this.AUDIO_ENCODER = 3;
|
||||
this.VIDEO_SOURCE = 1;
|
||||
this.VIDEO_ENCODER = 2;
|
||||
this.mVideoWidth = i;
|
||||
this.mVideoHeight = i2;
|
||||
this.mBitrate = i3;
|
||||
}
|
||||
|
||||
public CaptureConfiguration(int i, int i2, int i3, int i4, int i5) {
|
||||
this(i, i2, i3);
|
||||
this.mMaxDurationMs = i4 * MSEC_TO_SEC;
|
||||
this.mMaxFilesizeBytes = i5 * MBYTE_TO_BYTE;
|
||||
}
|
||||
|
||||
private CaptureConfiguration(Parcel parcel) {
|
||||
this.mVideoWidth = 1280;
|
||||
this.mVideoHeight = 720;
|
||||
this.mBitrate = 5000000;
|
||||
this.mMaxDurationMs = -1;
|
||||
this.mMaxFilesizeBytes = -1;
|
||||
this.OUTPUT_FORMAT = 2;
|
||||
this.AUDIO_SOURCE = 0;
|
||||
this.AUDIO_ENCODER = 3;
|
||||
this.VIDEO_SOURCE = 1;
|
||||
this.VIDEO_ENCODER = 2;
|
||||
this.mVideoWidth = parcel.readInt();
|
||||
this.mVideoHeight = parcel.readInt();
|
||||
this.mBitrate = parcel.readInt();
|
||||
this.mMaxDurationMs = parcel.readInt();
|
||||
this.mMaxFilesizeBytes = parcel.readInt();
|
||||
this.OUTPUT_FORMAT = parcel.readInt();
|
||||
this.AUDIO_SOURCE = parcel.readInt();
|
||||
this.AUDIO_ENCODER = parcel.readInt();
|
||||
this.VIDEO_SOURCE = parcel.readInt();
|
||||
this.VIDEO_ENCODER = parcel.readInt();
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.bottle.hp.album.capture.configuration;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
/* synthetic */ class PredefinedCaptureConfigurations$1 {
|
||||
static final /* synthetic */ int[] a = new int[PredefinedCaptureConfigurations$CaptureQuality.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[PredefinedCaptureConfigurations$CaptureQuality.HIGH.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[PredefinedCaptureConfigurations$CaptureQuality.MEDIUM.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
a[PredefinedCaptureConfigurations$CaptureQuality.LOW.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
package com.bottle.hp.album.capture.configuration;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum PredefinedCaptureConfigurations$CaptureQuality {
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
package com.bottle.hp.album.capture.configuration;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum PredefinedCaptureConfigurations$CaptureResolution {
|
||||
RES_360P(640, 360, 1000000, 700000, 300000),
|
||||
RES_480P(640, 480, 2500000, 1750000, 750000),
|
||||
RES_720P(1280, 720, 5000000, 3500000, 1500000),
|
||||
RES_1080P(1920, 1080, 8000000, 5600000, 2400000),
|
||||
RES_1440P(2560, 1440, 10000000, 7000000, 3000000),
|
||||
RES_2160P(3840, 2160, 40000000, 28000000, 12000000);
|
||||
|
||||
public int height;
|
||||
private final int highBitrate;
|
||||
private final int lowBitrate;
|
||||
private final int medBitrate;
|
||||
public int width;
|
||||
|
||||
PredefinedCaptureConfigurations$CaptureResolution(int i, int i2, int i3, int i4, int i5) {
|
||||
this.width = i;
|
||||
this.height = i2;
|
||||
this.highBitrate = i3;
|
||||
this.medBitrate = i4;
|
||||
this.lowBitrate = i5;
|
||||
}
|
||||
|
||||
public int getBitrate(PredefinedCaptureConfigurations$CaptureQuality predefinedCaptureConfigurations$CaptureQuality) {
|
||||
int i = this.highBitrate;
|
||||
int i2 = PredefinedCaptureConfigurations$1.a[predefinedCaptureConfigurations$CaptureQuality.ordinal()];
|
||||
return i2 != 1 ? i2 != 2 ? i2 != 3 ? i : this.lowBitrate : this.medBitrate : this.highBitrate;
|
||||
}
|
||||
}
|
@@ -0,0 +1,91 @@
|
||||
package com.bottle.hp.album.capture.preview;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
import com.bottle.hp.album.capture.camera.CameraWrapper;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CapturePreview implements SurfaceHolder.Callback {
|
||||
private final String a = CapturePreview.class.getSimpleName();
|
||||
private boolean b = true;
|
||||
private final CapturePreviewInterface c;
|
||||
public final CameraWrapper d;
|
||||
|
||||
public CapturePreview(CapturePreviewInterface capturePreviewInterface, CameraWrapper cameraWrapper, SurfaceHolder surfaceHolder) {
|
||||
this.c = capturePreviewInterface;
|
||||
this.d = cameraWrapper;
|
||||
a(surfaceHolder);
|
||||
}
|
||||
|
||||
private void a(SurfaceHolder surfaceHolder) {
|
||||
surfaceHolder.addCallback(this);
|
||||
surfaceHolder.setType(3);
|
||||
a(surfaceHolder, 0, 0);
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
|
||||
a(surfaceHolder, i2, i3);
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceCreated(SurfaceHolder surfaceHolder) {
|
||||
}
|
||||
|
||||
@Override // android.view.SurfaceHolder.Callback
|
||||
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
|
||||
}
|
||||
|
||||
private void a(SurfaceHolder surfaceHolder, int i, int i2) {
|
||||
if (this.b) {
|
||||
try {
|
||||
this.d.j();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.d.a(i, i2);
|
||||
try {
|
||||
this.d.a();
|
||||
} catch (RuntimeException e2) {
|
||||
e2.printStackTrace();
|
||||
ALog.a(this.a).d("AutoFocus not available for preview");
|
||||
}
|
||||
try {
|
||||
this.d.a(surfaceHolder);
|
||||
a(true);
|
||||
} catch (IOException e3) {
|
||||
e3.printStackTrace();
|
||||
ALog.a(this.a).d("Failed to show preview - unable to connect camera to preview (IOException)");
|
||||
this.c.i();
|
||||
} catch (RuntimeException e4) {
|
||||
e4.printStackTrace();
|
||||
ALog.a(this.a).d("Failed to show preview - unable to start camera preview (RuntimeException)");
|
||||
this.c.i();
|
||||
}
|
||||
} catch (RuntimeException e5) {
|
||||
e5.printStackTrace();
|
||||
Log.e(this.a, "Failed to show preview - invalid parameters set to camera preview");
|
||||
this.c.i();
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
if (this.b) {
|
||||
try {
|
||||
this.d.j();
|
||||
a(false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e(this.a, "Failed to clean up preview resources");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(boolean z) {
|
||||
this.b = z;
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.bottle.hp.album.capture.preview;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface CapturePreviewInterface {
|
||||
void i();
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.bottle.hp.album.capture.recorder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlreadyUsedException extends Exception {
|
||||
}
|
254
sources/com/bottle/hp/album/capture/recorder/VideoRecorder.java
Normal file
254
sources/com/bottle/hp/album/capture/recorder/VideoRecorder.java
Normal file
@@ -0,0 +1,254 @@
|
||||
package com.bottle.hp.album.capture.recorder;
|
||||
|
||||
import android.hardware.Camera;
|
||||
import android.media.CamcorderProfile;
|
||||
import android.media.MediaRecorder;
|
||||
import android.util.Log;
|
||||
import android.view.SurfaceHolder;
|
||||
import com.bottle.hp.album.capture.VideoFile;
|
||||
import com.bottle.hp.album.capture.camera.CameraWrapper;
|
||||
import com.bottle.hp.album.capture.camera.OpenCameraException;
|
||||
import com.bottle.hp.album.capture.camera.PrepareCameraException;
|
||||
import com.bottle.hp.album.capture.camera.RecordingSize;
|
||||
import com.bottle.hp.album.capture.configuration.CaptureConfiguration;
|
||||
import com.bottle.hp.album.capture.preview.CapturePreview;
|
||||
import com.bottle.hp.album.capture.preview.CapturePreviewInterface;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VideoRecorder implements MediaRecorder.OnInfoListener, CapturePreviewInterface {
|
||||
private CameraWrapper b;
|
||||
private CapturePreview c;
|
||||
private final CaptureConfiguration d;
|
||||
private final VideoFile e;
|
||||
private MediaRecorder f;
|
||||
private final VideoRecorderInterface h;
|
||||
private final String a = VideoRecorder.class.getSimpleName();
|
||||
private boolean g = false;
|
||||
|
||||
public VideoRecorder(VideoRecorderInterface videoRecorderInterface, CaptureConfiguration captureConfiguration, VideoFile videoFile, CameraWrapper cameraWrapper, SurfaceHolder surfaceHolder) {
|
||||
this.d = captureConfiguration;
|
||||
this.h = videoRecorderInterface;
|
||||
this.e = videoFile;
|
||||
this.b = cameraWrapper;
|
||||
surfaceHolder.getSurface();
|
||||
a(surfaceHolder);
|
||||
}
|
||||
|
||||
private boolean g() {
|
||||
if (this.b.b() == null) {
|
||||
throw new UnsupportedOperationException("No quality level found");
|
||||
}
|
||||
try {
|
||||
this.b.h();
|
||||
a(new MediaRecorder());
|
||||
try {
|
||||
a(a(), this.b.c());
|
||||
ALog.a(this.a).d("MediaRecorder successfully initialized");
|
||||
return true;
|
||||
} catch (IllegalArgumentException | IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
} catch (PrepareCameraException e2) {
|
||||
e2.printStackTrace();
|
||||
this.h.m("Unable to record video");
|
||||
Log.e(this.a, "Failed to initialize recorder - " + e2.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean h() {
|
||||
try {
|
||||
a().prepare();
|
||||
ALog.a(this.a).d("MediaRecorder successfully prepared");
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
ALog.a(this.a).d("MediaRecorder preparation failed - " + e.toString());
|
||||
return false;
|
||||
} catch (IllegalStateException e2) {
|
||||
e2.printStackTrace();
|
||||
ALog.a(this.a).d("MediaRecorder preparation failed - " + e2.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void j() {
|
||||
MediaRecorder a = a();
|
||||
if (a != null) {
|
||||
a.release();
|
||||
a((MediaRecorder) null);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean k() {
|
||||
try {
|
||||
a().start();
|
||||
ALog.a(this.a).d("MediaRecorder successfully started");
|
||||
return true;
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
ALog.a(this.a).d("MediaRecorder start failed - " + e.toString());
|
||||
return false;
|
||||
} catch (RuntimeException e2) {
|
||||
e2.printStackTrace();
|
||||
ALog.a(this.a).d("MediaRecorder start failed - " + e2.toString());
|
||||
this.h.m("Unable to record video with given settings");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(SurfaceHolder surfaceHolder) {
|
||||
try {
|
||||
this.b.g();
|
||||
this.c = new CapturePreview(this, this.b, surfaceHolder);
|
||||
} catch (OpenCameraException e) {
|
||||
e.printStackTrace();
|
||||
this.h.m(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public CapturePreview b() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public boolean c() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public void d() {
|
||||
CapturePreview capturePreview = this.c;
|
||||
if (capturePreview != null) {
|
||||
capturePreview.a();
|
||||
}
|
||||
CameraWrapper cameraWrapper = this.b;
|
||||
if (cameraWrapper != null) {
|
||||
cameraWrapper.i();
|
||||
this.b = null;
|
||||
}
|
||||
j();
|
||||
ALog.a(this.a).d("Released all resources");
|
||||
}
|
||||
|
||||
protected void e() {
|
||||
this.g = false;
|
||||
if (g() && h() && k()) {
|
||||
this.g = true;
|
||||
this.h.f0();
|
||||
ALog.a(this.a).d("Successfully started recording - outputfile: " + this.e.b());
|
||||
}
|
||||
}
|
||||
|
||||
public void f() throws AlreadyUsedException {
|
||||
if (this.b == null) {
|
||||
throw new AlreadyUsedException();
|
||||
}
|
||||
if (c()) {
|
||||
a((String) null);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
e();
|
||||
} catch (UnsupportedOperationException e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.preview.CapturePreviewInterface
|
||||
public void i() {
|
||||
this.h.m("Unable to show camera preview");
|
||||
}
|
||||
|
||||
@Override // android.media.MediaRecorder.OnInfoListener
|
||||
public void onInfo(MediaRecorder mediaRecorder, int i, int i2) {
|
||||
Locale locale = Locale.getDefault();
|
||||
if (i != 1) {
|
||||
if (i == 800) {
|
||||
ALog.a(this.a).d("MediaRecorder max duration reached");
|
||||
a(locale.getLanguage().equals("zh") ? "录制时间达到最长时间限制,停止录制。" : "Capture stopped - Max duration reached");
|
||||
} else {
|
||||
if (i != 801) {
|
||||
return;
|
||||
}
|
||||
ALog.a(this.a).d("MediaRecorder max filesize reached");
|
||||
a(locale.equals(Locale.CHINESE) ? "录制时间达到最长时间限制,停止录制。" : "Capture stopped - Max duration reached");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a(String str) {
|
||||
if (c()) {
|
||||
try {
|
||||
a().stop();
|
||||
this.h.u0();
|
||||
ALog.a(this.a).d("Successfully stopped recording - outputfile: " + this.e.b());
|
||||
} catch (RuntimeException unused) {
|
||||
ALog.a(this.a).d("Failed to stop recording");
|
||||
}
|
||||
this.g = false;
|
||||
this.h.l(str);
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(MediaRecorder mediaRecorder, Camera camera) throws IllegalStateException, IllegalArgumentException {
|
||||
mediaRecorder.setCamera(camera);
|
||||
mediaRecorder.setVideoSource(this.d.getVideoSource());
|
||||
if (this.h.j0()) {
|
||||
try {
|
||||
mediaRecorder.setAudioSource(this.d.getAudioSource());
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
}
|
||||
CamcorderProfile b = this.b.b();
|
||||
if (b != null) {
|
||||
b.fileFormat = this.d.getOutputFormat();
|
||||
RecordingSize b2 = this.b.b(this.d.getVideoWidth(), this.d.getVideoHeight());
|
||||
b.videoFrameWidth = b2.a;
|
||||
b.videoFrameHeight = b2.b;
|
||||
b.videoBitRate = this.d.getVideoBitrate();
|
||||
b.audioCodec = this.d.getAudioEncoder();
|
||||
b.videoCodec = this.d.getVideoEncoder();
|
||||
a(mediaRecorder, b);
|
||||
mediaRecorder.setMaxDuration(this.d.getMaxCaptureDuration());
|
||||
mediaRecorder.setOutputFile(this.e.b());
|
||||
mediaRecorder.setOrientationHint(this.b.e());
|
||||
try {
|
||||
mediaRecorder.setMaxFileSize(this.d.getMaxCaptureFileSize());
|
||||
} catch (IllegalArgumentException unused) {
|
||||
Log.e(this.a, "Failed to set max filesize - illegal argument: " + this.d.getMaxCaptureFileSize());
|
||||
} catch (RuntimeException unused2) {
|
||||
Log.e(this.a, "Failed to set max filesize - runtime exception");
|
||||
}
|
||||
mediaRecorder.setOnInfoListener(this);
|
||||
return;
|
||||
}
|
||||
throw new UnsupportedOperationException("No quality level found");
|
||||
}
|
||||
|
||||
private void a(MediaRecorder mediaRecorder, CamcorderProfile camcorderProfile) {
|
||||
mediaRecorder.setOutputFormat(camcorderProfile.fileFormat);
|
||||
mediaRecorder.setVideoFrameRate(camcorderProfile.videoFrameRate);
|
||||
mediaRecorder.setVideoSize(camcorderProfile.videoFrameWidth, camcorderProfile.videoFrameHeight);
|
||||
mediaRecorder.setVideoEncodingBitRate(camcorderProfile.videoBitRate);
|
||||
mediaRecorder.setVideoEncoder(camcorderProfile.videoCodec);
|
||||
int i = camcorderProfile.quality;
|
||||
if ((i < 1000 || i > 1007) && this.h.j0()) {
|
||||
mediaRecorder.setAudioEncodingBitRate(camcorderProfile.audioBitRate);
|
||||
mediaRecorder.setAudioChannels(camcorderProfile.audioChannels);
|
||||
mediaRecorder.setAudioSamplingRate(camcorderProfile.audioSampleRate);
|
||||
mediaRecorder.setAudioEncoder(camcorderProfile.audioCodec);
|
||||
}
|
||||
}
|
||||
|
||||
protected void a(MediaRecorder mediaRecorder) {
|
||||
this.f = mediaRecorder;
|
||||
}
|
||||
|
||||
protected MediaRecorder a() {
|
||||
return this.f;
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.bottle.hp.album.capture.recorder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface VideoRecorderInterface {
|
||||
void f0();
|
||||
|
||||
boolean j0();
|
||||
|
||||
void l(String str);
|
||||
|
||||
void m(String str);
|
||||
|
||||
void u0();
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.bottle.hp.album.capture.view;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IPictureCaptureListener {
|
||||
void a();
|
||||
|
||||
void b();
|
||||
|
||||
void onCancel();
|
||||
}
|
102
sources/com/bottle/hp/album/capture/view/PictureCaptureView.java
Normal file
102
sources/com/bottle/hp/album/capture/view/PictureCaptureView.java
Normal file
@@ -0,0 +1,102 @@
|
||||
package com.bottle.hp.album.capture.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PictureCaptureView extends FrameLayout implements View.OnClickListener {
|
||||
private IPictureCaptureListener a;
|
||||
private ImageView b;
|
||||
private ImageView c;
|
||||
private ImageView d;
|
||||
private ImageView e;
|
||||
private SurfaceView f;
|
||||
|
||||
public PictureCaptureView(Context context) {
|
||||
super(context);
|
||||
a(context);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.b.setVisibility(0);
|
||||
this.c.setVisibility(4);
|
||||
this.d.setVisibility(4);
|
||||
this.e.setVisibility(8);
|
||||
}
|
||||
|
||||
public SurfaceHolder getPreviewSurfaceHolder() {
|
||||
return this.f.getHolder();
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
IPictureCaptureListener iPictureCaptureListener;
|
||||
int id = view.getId();
|
||||
if (id == R$id.imgCapture) {
|
||||
IPictureCaptureListener iPictureCaptureListener2 = this.a;
|
||||
if (iPictureCaptureListener2 != null) {
|
||||
iPictureCaptureListener2.b();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == R$id.imgOK) {
|
||||
IPictureCaptureListener iPictureCaptureListener3 = this.a;
|
||||
if (iPictureCaptureListener3 != null) {
|
||||
iPictureCaptureListener3.a();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id != R$id.imgCancel || (iPictureCaptureListener = this.a) == null) {
|
||||
return;
|
||||
}
|
||||
iPictureCaptureListener.onCancel();
|
||||
}
|
||||
|
||||
public void setPictureCaptureListener(IPictureCaptureListener iPictureCaptureListener) {
|
||||
this.a = iPictureCaptureListener;
|
||||
}
|
||||
|
||||
public PictureCaptureView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
a(context);
|
||||
}
|
||||
|
||||
public PictureCaptureView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
a(context);
|
||||
}
|
||||
|
||||
public void a(String str) {
|
||||
this.b.setVisibility(4);
|
||||
this.c.setVisibility(0);
|
||||
this.d.setVisibility(0);
|
||||
this.e.setVisibility(0);
|
||||
a(this.e, str);
|
||||
}
|
||||
|
||||
private void a(Context context) {
|
||||
View inflate = View.inflate(context, R$layout.view_picture_capture, this);
|
||||
this.b = (ImageView) inflate.findViewById(R$id.imgCapture);
|
||||
this.c = (ImageView) inflate.findViewById(R$id.imgOK);
|
||||
this.d = (ImageView) inflate.findViewById(R$id.imgCancel);
|
||||
this.e = (ImageView) inflate.findViewById(R$id.imgPreview);
|
||||
this.b.setOnClickListener(this);
|
||||
this.c.setOnClickListener(this);
|
||||
this.d.setOnClickListener(this);
|
||||
this.f = (SurfaceView) inflate.findViewById(R$id.surfaceView);
|
||||
}
|
||||
|
||||
private void a(ImageView imageView, String str) {
|
||||
Glide.e(getContext()).a(str).a(imageView);
|
||||
}
|
||||
}
|
214
sources/com/bottle/hp/album/capture/view/VideoCaptureView.java
Normal file
214
sources/com/bottle/hp/album/capture/view/VideoCaptureView.java
Normal file
@@ -0,0 +1,214 @@
|
||||
package com.bottle.hp.album.capture.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.R$mipmap;
|
||||
import com.bottle.hp.album.R$string;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.chrisbanes.photoview.PhotoView;
|
||||
import com.ubtrobot.log.ALog;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class VideoCaptureView extends FrameLayout implements View.OnClickListener, View.OnTouchListener {
|
||||
private final String a;
|
||||
private SurfaceView b;
|
||||
private ImageView c;
|
||||
private ImageView d;
|
||||
private ProgressBar e;
|
||||
private ImageView f;
|
||||
private ImageView g;
|
||||
private PhotoView h;
|
||||
private ImageView i;
|
||||
private TextView j;
|
||||
private RelativeLayout k;
|
||||
private ImageView l;
|
||||
private IVideoCaptureUIListener m;
|
||||
|
||||
public interface IVideoCaptureUIListener {
|
||||
void B0();
|
||||
|
||||
void h0();
|
||||
|
||||
void onCancel();
|
||||
|
||||
void r0();
|
||||
|
||||
void t0();
|
||||
|
||||
void x0();
|
||||
|
||||
void y0();
|
||||
}
|
||||
|
||||
public VideoCaptureView(Context context) {
|
||||
super(context);
|
||||
this.a = VideoCaptureView.class.getSimpleName();
|
||||
a(context);
|
||||
}
|
||||
|
||||
private void a(Context context) {
|
||||
View inflate = View.inflate(context, R$layout.view_video_capture, this);
|
||||
this.b = (SurfaceView) inflate.findViewById(R$id.surfaceView);
|
||||
this.c = (ImageView) inflate.findViewById(R$id.imgBack);
|
||||
this.d = (ImageView) inflate.findViewById(R$id.imgChangeCamera);
|
||||
this.e = (ProgressBar) inflate.findViewById(R$id.progressBar);
|
||||
this.f = (ImageView) inflate.findViewById(R$id.imgCancel);
|
||||
this.g = (ImageView) inflate.findViewById(R$id.imgAccept);
|
||||
this.h = (PhotoView) inflate.findViewById(R$id.imgPreview);
|
||||
this.i = (ImageView) inflate.findViewById(R$id.imgStartPlay);
|
||||
this.j = (TextView) inflate.findViewById(R$id.tvTips);
|
||||
this.k = (RelativeLayout) inflate.findViewById(R$id.rlBottom);
|
||||
this.l = (ImageView) inflate.findViewById(R$id.imgCaptureBackground);
|
||||
this.c.setOnClickListener(this);
|
||||
this.d.setOnClickListener(this);
|
||||
this.l.setOnClickListener(this);
|
||||
this.c.setOnClickListener(this);
|
||||
this.f.setOnClickListener(this);
|
||||
this.g.setOnClickListener(this);
|
||||
this.l.setOnTouchListener(this);
|
||||
this.i.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void f() {
|
||||
this.i.setVisibility(8);
|
||||
}
|
||||
|
||||
private void g() {
|
||||
this.i.setVisibility(0);
|
||||
}
|
||||
|
||||
public void b() {
|
||||
this.l.setVisibility(0);
|
||||
this.e.setVisibility(8);
|
||||
this.l.setImageResource(R$mipmap.capture);
|
||||
this.j.setVisibility(0);
|
||||
this.h.setVisibility(4);
|
||||
this.i.setVisibility(8);
|
||||
this.c.setVisibility(0);
|
||||
this.d.setVisibility(0);
|
||||
this.k.setVisibility(8);
|
||||
this.e.setProgress(0);
|
||||
}
|
||||
|
||||
public void c() {
|
||||
this.j.setText("");
|
||||
}
|
||||
|
||||
public void d() {
|
||||
this.j.setVisibility(8);
|
||||
this.l.setImageResource(R$mipmap.capture_videotape);
|
||||
this.e.setVisibility(0);
|
||||
}
|
||||
|
||||
public void e() {
|
||||
this.j.setText(getContext().getString(R$string.please_add_video));
|
||||
}
|
||||
|
||||
public SurfaceHolder getPreviewSurfaceHolder() {
|
||||
return this.b.getHolder();
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R$id.imgBack) {
|
||||
this.m.y0();
|
||||
return;
|
||||
}
|
||||
if (id == R$id.imgChangeCamera) {
|
||||
this.m.B0();
|
||||
return;
|
||||
}
|
||||
if (id == R$id.imgCancel) {
|
||||
this.m.onCancel();
|
||||
} else if (id == R$id.imgAccept) {
|
||||
this.m.x0();
|
||||
} else if (id == R$id.imgStartPlay) {
|
||||
this.m.t0();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnTouchListener
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
ImageView imageView = this.l;
|
||||
if (imageView == null || !imageView.equals(view) || motionEvent == null || this.m == null) {
|
||||
return false;
|
||||
}
|
||||
int action = motionEvent.getAction();
|
||||
if (action == 0) {
|
||||
ALog.a(this.a).d("action down");
|
||||
this.m.h0();
|
||||
return true;
|
||||
}
|
||||
if (action != 1) {
|
||||
if (action == 2) {
|
||||
ALog.a(this.a).d("action move");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
ALog.a(this.a).d("action up");
|
||||
this.m.r0();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setUIListener(IVideoCaptureUIListener iVideoCaptureUIListener) {
|
||||
this.m = iVideoCaptureUIListener;
|
||||
}
|
||||
|
||||
public VideoCaptureView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
this.a = VideoCaptureView.class.getSimpleName();
|
||||
a(context);
|
||||
}
|
||||
|
||||
public VideoCaptureView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
this.a = VideoCaptureView.class.getSimpleName();
|
||||
a(context);
|
||||
}
|
||||
|
||||
private void a(ImageView imageView, String str) {
|
||||
Glide.e(getContext()).a(str).a(imageView);
|
||||
}
|
||||
|
||||
public void a(String str, int i) {
|
||||
this.j.setVisibility(8);
|
||||
this.c.setVisibility(8);
|
||||
this.d.setVisibility(8);
|
||||
this.l.setVisibility(8);
|
||||
this.e.setVisibility(8);
|
||||
this.e.setProgress(0);
|
||||
this.k.setVisibility(0);
|
||||
this.h.setVisibility(0);
|
||||
if (1 == i) {
|
||||
Bitmap a = Utils.a(str);
|
||||
this.h.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
this.h.setImageBitmap(a);
|
||||
g();
|
||||
return;
|
||||
}
|
||||
a(this.h, str);
|
||||
f();
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.e.setProgress(i);
|
||||
}
|
||||
|
||||
public void a() {
|
||||
this.j.setText(getContext().getString(R$string.tips_photo_or_video));
|
||||
}
|
||||
}
|
92
sources/com/bottle/hp/album/gallery/ActivityGallery.java
Normal file
92
sources/com/bottle/hp/album/gallery/ActivityGallery.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package com.bottle.hp.album.gallery;
|
||||
|
||||
import android.R;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ActivityGallery extends AppCompatActivity implements AdapterView.OnItemSelectedListener, AdapterView.OnItemClickListener {
|
||||
private GridView a;
|
||||
private AdapterGallery b;
|
||||
private Map<String, List<String>> c;
|
||||
private Spinner d;
|
||||
private ArrayAdapter<String> e;
|
||||
private List<String> f;
|
||||
private ArrayList<String> g;
|
||||
|
||||
private void D0() {
|
||||
this.c.put("all", new ArrayList());
|
||||
Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
||||
Cursor query = getContentResolver().query(uri, new String[]{"_data", "bucket_display_name"}, null, null, "date_modified DESC");
|
||||
if (query != null) {
|
||||
int columnIndex = query.getColumnIndex("_data");
|
||||
int columnIndex2 = query.getColumnIndex("bucket_display_name");
|
||||
while (query.moveToNext()) {
|
||||
String string = query.getString(columnIndex2);
|
||||
List<String> list = this.c.get(string);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
this.c.put(string, list);
|
||||
}
|
||||
String string2 = query.getString(columnIndex);
|
||||
list.add(string2);
|
||||
this.c.get("all").add(string2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
D0();
|
||||
this.b.a(this.c.get("all"));
|
||||
this.f = new ArrayList();
|
||||
this.f.addAll(this.c.keySet());
|
||||
this.e = new ArrayAdapter<>(this, R.layout.simple_spinner_item, this.f);
|
||||
this.e.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
|
||||
this.d.setAdapter((SpinnerAdapter) this.e);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_gallery);
|
||||
this.a = (GridView) findViewById(R$id.grid_view);
|
||||
this.d = (Spinner) findViewById(R$id.spinner);
|
||||
this.d.setOnItemSelectedListener(this);
|
||||
this.b = new AdapterGallery(this);
|
||||
this.a.setAdapter((ListAdapter) this.b);
|
||||
this.c = new HashMap();
|
||||
this.a.setOnItemClickListener(this);
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
|
||||
GalleryPreviewActivity.a(this, this.g, i);
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemSelectedListener
|
||||
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
|
||||
this.g = (ArrayList) this.c.get(this.e.getItem(i));
|
||||
this.b.b(this.g);
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemSelectedListener
|
||||
public void onNothingSelected(AdapterView<?> adapterView) {
|
||||
}
|
||||
}
|
79
sources/com/bottle/hp/album/gallery/AdapterGallery.java
Normal file
79
sources/com/bottle/hp/album/gallery/AdapterGallery.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.bottle.hp.album.gallery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bumptech.glide.Glide;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AdapterGallery extends BaseAdapter {
|
||||
private List<String> a = new ArrayList();
|
||||
private Context b;
|
||||
|
||||
private class ViewHolder {
|
||||
public ImageView a;
|
||||
|
||||
private ViewHolder(AdapterGallery adapterGallery) {
|
||||
}
|
||||
}
|
||||
|
||||
public AdapterGallery(Context context) {
|
||||
this.b = context;
|
||||
}
|
||||
|
||||
public void a(List<String> list) {
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
this.a.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void b(List<String> list) {
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
this.a.clear();
|
||||
this.a.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getCount() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public Object getItem(int i) {
|
||||
return this.a.get(i);
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
View view2;
|
||||
ViewHolder viewHolder;
|
||||
if (view == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
view2 = LayoutInflater.from(this.b).inflate(R$layout.adapter_gallery, (ViewGroup) null);
|
||||
viewHolder.a = (ImageView) view2.findViewById(R$id.img_snapshoot);
|
||||
view2.setTag(viewHolder);
|
||||
} else {
|
||||
view2 = view;
|
||||
viewHolder = (ViewHolder) view.getTag();
|
||||
}
|
||||
Glide.e(this.b).a(this.a.get(i)).a(viewHolder.a);
|
||||
return view2;
|
||||
}
|
||||
}
|
47
sources/com/bottle/hp/album/gallery/AdapterSamplePager.java
Normal file
47
sources/com/bottle/hp/album/gallery/AdapterSamplePager.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.bottle.hp.album.gallery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.chrisbanes.photoview.PhotoView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AdapterSamplePager extends PagerAdapter {
|
||||
private List<String> a;
|
||||
private Context b;
|
||||
|
||||
public AdapterSamplePager(Context context, List<String> list) {
|
||||
this.a = list == null ? new ArrayList<>() : list;
|
||||
this.b = context;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
viewGroup.removeView((View) obj);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public int getCount() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public boolean isViewFromObject(View view, Object obj) {
|
||||
return view == obj;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public View instantiateItem(ViewGroup viewGroup, int i) {
|
||||
PhotoView photoView = new PhotoView(viewGroup.getContext());
|
||||
photoView.setBackgroundColor(Color.argb(255, 0, 0, 0));
|
||||
Glide.e(this.b).a(this.a.get(i)).a((ImageView) photoView);
|
||||
viewGroup.addView(photoView, -1, -1);
|
||||
return photoView;
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package com.bottle.hp.album.gallery;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.photoview.HackyViewPager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class GalleryPreviewActivity extends AppCompatActivity {
|
||||
private HackyViewPager a;
|
||||
private AdapterSamplePager b;
|
||||
private List<String> c;
|
||||
|
||||
public static void a(Activity activity, ArrayList<String> arrayList, int i) {
|
||||
Intent intent = new Intent(activity, (Class<?>) GalleryPreviewActivity.class);
|
||||
intent.putExtra("data", arrayList);
|
||||
intent.putExtra("index", i);
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_gallery_preview);
|
||||
this.a = (HackyViewPager) findViewById(R$id.hackyViewPager);
|
||||
this.c = (List) getIntent().getSerializableExtra("data");
|
||||
this.b = new AdapterSamplePager(this, this.c);
|
||||
this.a.setAdapter(this.b);
|
||||
this.a.setCurrentItem(getIntent().getIntExtra("index", 0));
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
}
|
93
sources/com/bottle/hp/album/media/HPAudio.java
Normal file
93
sources/com/bottle/hp/album/media/HPAudio.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.provider.MediaStore;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPAudio extends HPMedia implements Serializable {
|
||||
private String album;
|
||||
private String artist;
|
||||
private long duration;
|
||||
|
||||
public HPAudio() {
|
||||
this.mediaType = 2;
|
||||
}
|
||||
|
||||
public static List<HPAudio> getAudios(Context context) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (context == null) {
|
||||
return arrayList;
|
||||
}
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[]{FileDownloadModel.ID, "title", "_data", "_display_name", "mime_type", "_size", "album", "artist", "duration", "date_modified"}, null, null, "date_modified DESC");
|
||||
if (query != null) {
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("album");
|
||||
int columnIndex8 = query.getColumnIndex("artist");
|
||||
int columnIndex9 = query.getColumnIndex("duration");
|
||||
int columnIndex10 = query.getColumnIndex("date_modified");
|
||||
while (query.moveToNext()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
String string3 = query.getString(columnIndex4);
|
||||
String string4 = query.getString(columnIndex5);
|
||||
long j = query.getLong(columnIndex6);
|
||||
String string5 = query.getString(columnIndex7);
|
||||
String string6 = query.getString(columnIndex8);
|
||||
int i2 = columnIndex;
|
||||
long j2 = query.getInt(columnIndex9);
|
||||
int i3 = columnIndex3;
|
||||
HPAudio hPAudio = new HPAudio(i, string, string2, string3, string4, j, "", query.getString(columnIndex10));
|
||||
hPAudio.setAlbum(string5);
|
||||
hPAudio.setArtist(string6);
|
||||
hPAudio.setDuration(j2);
|
||||
arrayList.add(hPAudio);
|
||||
columnIndex = i2;
|
||||
columnIndex2 = columnIndex2;
|
||||
columnIndex3 = i3;
|
||||
columnIndex4 = columnIndex4;
|
||||
}
|
||||
query.close();
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public String getAlbum() {
|
||||
return this.album;
|
||||
}
|
||||
|
||||
public String getArtist() {
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
public long getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public void setAlbum(String str) {
|
||||
this.album = str;
|
||||
}
|
||||
|
||||
public void setArtist(String str) {
|
||||
this.artist = str;
|
||||
}
|
||||
|
||||
public void setDuration(long j) {
|
||||
this.duration = j;
|
||||
}
|
||||
|
||||
public HPAudio(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
super(i, str, str2, str3, str4, j, str5, str6);
|
||||
this.mediaType = 2;
|
||||
}
|
||||
}
|
70
sources/com/bottle/hp/album/media/HPImage.java
Normal file
70
sources/com/bottle/hp/album/media/HPImage.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.provider.MediaStore;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPImage extends HPMedia implements Serializable {
|
||||
private static final String TAG = HPMedia.class.getSimpleName();
|
||||
private static String[] thumbColumns = {FileDownloadModel.ID, "image_id", "_data"};
|
||||
private static String[] projection = {FileDownloadModel.ID, "title", "_data", "_display_name", "mime_type", "_size", "date_modified"};
|
||||
|
||||
public HPImage() {
|
||||
this.mediaType = 0;
|
||||
}
|
||||
|
||||
public static List<HPMedia> getImages(Context context) {
|
||||
Cursor query;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (context != null && (query = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, "date_modified DESC")) != null) {
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("date_modified");
|
||||
while (query.moveToNext()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
arrayList.add(new HPImage(i, string, query.getString(columnIndex4), query.getString(columnIndex5), string2, query.getLong(columnIndex6), string2, query.getString(columnIndex7)));
|
||||
}
|
||||
query.close();
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static HPMedia searchImageByName(Context context, String str) {
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, "_data=?", new String[]{str + ""}, null);
|
||||
HPImage hPImage = null;
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("date_modified");
|
||||
if (query.moveToNext()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
hPImage = new HPImage(i, string, query.getString(columnIndex4), query.getString(columnIndex5), string2, query.getLong(columnIndex6), string2, query.getString(columnIndex7));
|
||||
}
|
||||
query.close();
|
||||
return hPImage;
|
||||
}
|
||||
|
||||
public HPImage(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
super(i, str, str2, str3, str4, j, str5, str6);
|
||||
this.mediaType = 0;
|
||||
}
|
||||
}
|
127
sources/com/bottle/hp/album/media/HPMedia.java
Normal file
127
sources/com/bottle/hp/album/media/HPMedia.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPMedia implements Serializable {
|
||||
public static final int MEDIA_TYPE_AUDIO = 2;
|
||||
public static final int MEDIA_TYPE_IMAGE = 0;
|
||||
public static final int MEDIA_TYPE_NONE = -1;
|
||||
public static final int MEDIA_TYPE_VIDEO = 1;
|
||||
protected String displayName;
|
||||
protected int id;
|
||||
protected int mediaType;
|
||||
protected String mimeType;
|
||||
protected String modifyDate;
|
||||
protected String path;
|
||||
protected String preview;
|
||||
protected boolean selected;
|
||||
protected long size;
|
||||
protected String title;
|
||||
|
||||
public HPMedia() {
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public int getMediaType() {
|
||||
return this.mediaType;
|
||||
}
|
||||
|
||||
public String getMimeType() {
|
||||
return this.mimeType;
|
||||
}
|
||||
|
||||
public String getModifyDate() {
|
||||
return this.modifyDate;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public String getPreview() {
|
||||
return this.preview;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return this.selected;
|
||||
}
|
||||
|
||||
public boolean isVideo() {
|
||||
return this.mediaType == 1;
|
||||
}
|
||||
|
||||
public void setDisplayName(String str) {
|
||||
this.displayName = str;
|
||||
}
|
||||
|
||||
public void setId(int i) {
|
||||
this.id = i;
|
||||
}
|
||||
|
||||
public void setMediaType(int i) {
|
||||
this.mediaType = i;
|
||||
}
|
||||
|
||||
public void setMimeType(String str) {
|
||||
this.mimeType = str;
|
||||
}
|
||||
|
||||
public void setModifyDate(String str) {
|
||||
this.modifyDate = str;
|
||||
}
|
||||
|
||||
public void setPath(String str) {
|
||||
this.path = str;
|
||||
}
|
||||
|
||||
public void setPreview(String str) {
|
||||
this.preview = str;
|
||||
}
|
||||
|
||||
public void setSelected(boolean z) {
|
||||
this.selected = z;
|
||||
}
|
||||
|
||||
public void setSize(long j) {
|
||||
this.size = j;
|
||||
}
|
||||
|
||||
public void setTitle(String str) {
|
||||
this.title = str;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "HPMedia{id=" + this.id + ", title='" + this.title + "', displayName='" + this.displayName + "', mimeType='" + this.mimeType + "', path='" + this.path + "', size=" + this.size + ", modifyDate='" + this.modifyDate + "', preview='" + this.preview + "', selected=" + this.selected + ", mediaType=" + this.mediaType + '}';
|
||||
}
|
||||
|
||||
public HPMedia(int i) {
|
||||
this.id = i;
|
||||
}
|
||||
|
||||
public HPMedia(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
this.id = i;
|
||||
this.title = str;
|
||||
this.displayName = str2;
|
||||
this.mimeType = str3;
|
||||
this.path = str4;
|
||||
this.size = j;
|
||||
this.preview = str5;
|
||||
this.modifyDate = str6;
|
||||
}
|
||||
}
|
213
sources/com/bottle/hp/album/media/HPVideo.java
Normal file
213
sources/com/bottle/hp/album/media/HPVideo.java
Normal file
@@ -0,0 +1,213 @@
|
||||
package com.bottle.hp.album.media;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
import android.provider.MediaStore;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPVideo extends HPMedia implements Serializable {
|
||||
private static String[] projection = {FileDownloadModel.ID, "title", "_data", "_display_name", "mime_type", "_size", "album", "artist", "duration", "date_modified"};
|
||||
private static String[] thumbColumns = {FileDownloadModel.ID, "video_id", "_data"};
|
||||
private String album;
|
||||
private String artist;
|
||||
private long duration;
|
||||
|
||||
public HPVideo() {
|
||||
super(0, "title", "displayName", "mimeType", "", 0L, "", "");
|
||||
this.mediaType = 1;
|
||||
}
|
||||
|
||||
public static long getVideoDuration(String str) {
|
||||
try {
|
||||
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();
|
||||
mediaMetadataRetriever.setDataSource(str);
|
||||
return Long.parseLong(mediaMetadataRetriever.extractMetadata(9));
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public static HPMedia getVideoThumnail(Context context, HPMedia hPMedia) {
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI, thumbColumns, "video_id=?", new String[]{hPMedia.getId() + ""}, null);
|
||||
if (query == null || !query.moveToFirst()) {
|
||||
Utils.a(context.getContentResolver(), hPMedia.getPath(), 3);
|
||||
} else {
|
||||
hPMedia.setPreview(query.getString(query.getColumnIndex("_data")));
|
||||
}
|
||||
if (query != null) {
|
||||
query.close();
|
||||
}
|
||||
return hPMedia;
|
||||
}
|
||||
|
||||
public static List<HPMedia> getVideos(Context context) {
|
||||
Cursor query;
|
||||
ArrayList arrayList = new ArrayList();
|
||||
if (context == null || (query = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection, null, null, "date_modified DESC")) == null) {
|
||||
return arrayList;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("album");
|
||||
int columnIndex8 = query.getColumnIndex("artist");
|
||||
int columnIndex9 = query.getColumnIndex("duration");
|
||||
int columnIndex10 = query.getColumnIndex("date_modified");
|
||||
if (query.moveToFirst()) {
|
||||
while (true) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
String string3 = query.getString(columnIndex4);
|
||||
String string4 = query.getString(columnIndex5);
|
||||
long j = query.getLong(columnIndex6);
|
||||
String string5 = query.getString(columnIndex7);
|
||||
String string6 = query.getString(columnIndex8);
|
||||
int i2 = columnIndex;
|
||||
int i3 = columnIndex2;
|
||||
long j2 = query.getInt(columnIndex9);
|
||||
int i4 = columnIndex3;
|
||||
int i5 = columnIndex4;
|
||||
HPVideo hPVideo = new HPVideo(i, string, string3, string4, string2, j, "", query.getString(columnIndex10));
|
||||
hPVideo.setAlbum(string5);
|
||||
hPVideo.setArtist(string6);
|
||||
hPVideo.setDuration(j2);
|
||||
arrayList.add(hPVideo);
|
||||
if (!query.moveToNext()) {
|
||||
break;
|
||||
}
|
||||
columnIndex = i2;
|
||||
columnIndex2 = i3;
|
||||
columnIndex3 = i4;
|
||||
columnIndex4 = i5;
|
||||
}
|
||||
}
|
||||
query.close();
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static HPVideo searchVideoByName(Context context, String str) {
|
||||
Cursor query = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection, "_data=?", new String[]{str + ""}, null);
|
||||
HPVideo hPVideo = null;
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
int columnIndex = query.getColumnIndex(FileDownloadModel.ID);
|
||||
int columnIndex2 = query.getColumnIndex("title");
|
||||
int columnIndex3 = query.getColumnIndex("_data");
|
||||
int columnIndex4 = query.getColumnIndex("_display_name");
|
||||
int columnIndex5 = query.getColumnIndex("mime_type");
|
||||
int columnIndex6 = query.getColumnIndex("_size");
|
||||
int columnIndex7 = query.getColumnIndex("album");
|
||||
int columnIndex8 = query.getColumnIndex("artist");
|
||||
int columnIndex9 = query.getColumnIndex("duration");
|
||||
int columnIndex10 = query.getColumnIndex("date_modified");
|
||||
if (query.moveToFirst()) {
|
||||
int i = query.getInt(columnIndex);
|
||||
String string = query.getString(columnIndex2);
|
||||
String string2 = query.getString(columnIndex3);
|
||||
String string3 = query.getString(columnIndex4);
|
||||
String string4 = query.getString(columnIndex5);
|
||||
long j = query.getLong(columnIndex6);
|
||||
String string5 = query.getString(columnIndex7);
|
||||
String string6 = query.getString(columnIndex8);
|
||||
long j2 = query.getInt(columnIndex9);
|
||||
HPVideo hPVideo2 = new HPVideo(i, string, string3, string4, string2, j, "", query.getString(columnIndex10));
|
||||
hPVideo2.setAlbum(string5);
|
||||
hPVideo2.setArtist(string6);
|
||||
hPVideo2.setDuration(j2);
|
||||
hPVideo = hPVideo2;
|
||||
}
|
||||
query.close();
|
||||
return hPVideo;
|
||||
}
|
||||
|
||||
public String getAlbum() {
|
||||
return this.album;
|
||||
}
|
||||
|
||||
public String getArtist() {
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
public long getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:13:0x001f, code lost:
|
||||
|
||||
if (r1 == null) goto L15;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x0026 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public android.graphics.Bitmap getFirstFrame() {
|
||||
/*
|
||||
r4 = this;
|
||||
r0 = 0
|
||||
android.media.MediaMetadataRetriever r1 = new android.media.MediaMetadataRetriever // Catch: java.lang.Throwable -> L15 java.lang.Exception -> L1a
|
||||
r1.<init>() // Catch: java.lang.Throwable -> L15 java.lang.Exception -> L1a
|
||||
java.lang.String r2 = r4.path // Catch: java.lang.Exception -> L13 java.lang.Throwable -> L23
|
||||
r1.setDataSource(r2) // Catch: java.lang.Exception -> L13 java.lang.Throwable -> L23
|
||||
android.graphics.Bitmap r0 = r1.getFrameAtTime() // Catch: java.lang.Exception -> L13 java.lang.Throwable -> L23
|
||||
Lf:
|
||||
r1.release()
|
||||
goto L22
|
||||
L13:
|
||||
r2 = move-exception
|
||||
goto L1c
|
||||
L15:
|
||||
r1 = move-exception
|
||||
r3 = r1
|
||||
r1 = r0
|
||||
r0 = r3
|
||||
goto L24
|
||||
L1a:
|
||||
r2 = move-exception
|
||||
r1 = r0
|
||||
L1c:
|
||||
r2.printStackTrace() // Catch: java.lang.Throwable -> L23
|
||||
if (r1 == 0) goto L22
|
||||
goto Lf
|
||||
L22:
|
||||
return r0
|
||||
L23:
|
||||
r0 = move-exception
|
||||
L24:
|
||||
if (r1 == 0) goto L29
|
||||
r1.release()
|
||||
L29:
|
||||
throw r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.bottle.hp.album.media.HPVideo.getFirstFrame():android.graphics.Bitmap");
|
||||
}
|
||||
|
||||
public void setAlbum(String str) {
|
||||
this.album = str;
|
||||
}
|
||||
|
||||
public void setArtist(String str) {
|
||||
this.artist = str;
|
||||
}
|
||||
|
||||
public void setDuration(long j) {
|
||||
this.duration = j;
|
||||
}
|
||||
|
||||
public HPVideo(int i, String str, String str2, String str3, String str4, long j, String str5, String str6) {
|
||||
super(i, str, str2, str3, str4, j, str5, str6);
|
||||
this.mediaType = 1;
|
||||
}
|
||||
}
|
27
sources/com/bottle/hp/album/photoview/HackyViewPager.java
Normal file
27
sources/com/bottle/hp/album/photoview/HackyViewPager.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.bottle.hp.album.photoview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HackyViewPager extends ViewPager {
|
||||
public HackyViewPager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager, android.view.ViewGroup
|
||||
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
|
||||
try {
|
||||
return super.onInterceptTouchEvent(motionEvent);
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public HackyViewPager(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
}
|
||||
}
|
413
sources/com/bottle/hp/album/selector/AlbumActivity.java
Normal file
413
sources/com/bottle/hp/album/selector/AlbumActivity.java
Normal file
@@ -0,0 +1,413 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.GridView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListAdapter;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import com.bottle.hp.album.BaseActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.R$string;
|
||||
import com.bottle.hp.album.capture.VideoCaptureActivity;
|
||||
import com.bottle.hp.album.media.HPImage;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import com.bottle.hp.album.media.HPVideo;
|
||||
import com.bottle.hp.album.selector.AlbumAdapter;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import com.ubt.jimu.base.entities.Constant;
|
||||
import com.ubtech.permission.JimuPermissionRequest;
|
||||
import com.ubtech.permission.PermissionRequestListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlbumActivity extends BaseActivity implements AdapterView.OnItemClickListener, View.OnClickListener {
|
||||
public static List<HPMedia> m = new ArrayList();
|
||||
public static List<HPMedia> n = new ArrayList();
|
||||
private GridView c;
|
||||
private AlbumAdapter d;
|
||||
private List<HPMedia> e = new ArrayList();
|
||||
private ArrayList<HPMedia> f = new ArrayList<>();
|
||||
private int g = 5;
|
||||
private int h;
|
||||
private ImageView i;
|
||||
private Button j;
|
||||
private String k;
|
||||
private Handler l;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void F0() {
|
||||
this.e.add(E0());
|
||||
this.e.addAll(n);
|
||||
this.e.addAll(m);
|
||||
Collections.sort(this.e, new HPMediaComparator());
|
||||
this.d = new AlbumAdapter(this, this.e, new AlbumAdapter.IAlbumAdapterUIListener() { // from class: com.bottle.hp.album.selector.AlbumActivity.5
|
||||
@Override // com.bottle.hp.album.selector.AlbumAdapter.IAlbumAdapterUIListener
|
||||
public void a(CompoundButton compoundButton, boolean z, HPMedia hPMedia) {
|
||||
if (!z) {
|
||||
hPMedia.setSelected(false);
|
||||
Iterator it = AlbumActivity.this.f.iterator();
|
||||
while (true) {
|
||||
if (!it.hasNext()) {
|
||||
break;
|
||||
}
|
||||
HPMedia hPMedia2 = (HPMedia) it.next();
|
||||
if (hPMedia2.getId() == hPMedia.getId()) {
|
||||
AlbumActivity.this.f.remove(hPMedia2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (AlbumActivity.this.f.size() > 0) {
|
||||
AlbumActivity.this.j.setText(AlbumActivity.this.k + "(" + AlbumActivity.this.f.size() + "/" + AlbumActivity.this.h + ")");
|
||||
} else {
|
||||
AlbumActivity.this.j.setText(AlbumActivity.this.k);
|
||||
AlbumActivity.this.j.setEnabled(false);
|
||||
}
|
||||
} else if (AlbumActivity.this.f.size() >= AlbumActivity.this.h) {
|
||||
AlbumActivity.this.a(AlbumActivity.this.getString(R$string.number_limit), 0);
|
||||
compoundButton.setSelected(false);
|
||||
} else {
|
||||
hPMedia.setSelected(true);
|
||||
AlbumActivity.this.f.add(hPMedia);
|
||||
AlbumActivity.this.j.setText(AlbumActivity.this.k + "(" + AlbumActivity.this.f.size() + "/" + AlbumActivity.this.h + ")");
|
||||
if (!AlbumActivity.this.j.isEnabled()) {
|
||||
AlbumActivity.this.j.setEnabled(true);
|
||||
}
|
||||
}
|
||||
AlbumActivity.this.d.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
this.c.setAdapter((ListAdapter) this.d);
|
||||
ArrayList<HPMedia> arrayList = this.f;
|
||||
if (arrayList == null || arrayList.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
this.j.setText(this.k + "(" + this.f.size() + "/" + this.h + ")");
|
||||
this.j.setEnabled(true);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void initData() {
|
||||
ArrayList arrayList = (ArrayList) getIntent().getSerializableExtra("input_selected");
|
||||
if (arrayList != null && arrayList.size() > 0) {
|
||||
this.f.addAll(arrayList);
|
||||
}
|
||||
new Thread(new Runnable() { // from class: com.bottle.hp.album.selector.AlbumActivity.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
if (AlbumActivity.this.g == 1) {
|
||||
AlbumActivity.m.addAll(HPImage.getImages(AlbumActivity.this));
|
||||
} else if (AlbumActivity.this.g == 2) {
|
||||
AlbumActivity.n.addAll(HPVideo.getVideos(AlbumActivity.this));
|
||||
} else {
|
||||
AlbumActivity.m.addAll(HPImage.getImages(AlbumActivity.this));
|
||||
AlbumActivity.n.addAll(HPVideo.getVideos(AlbumActivity.this));
|
||||
}
|
||||
AlbumActivity.this.l.sendEmptyMessage(Constant.Publish.REQUEST_CODE_PICK_FILE);
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
Iterator it = AlbumActivity.this.f.iterator();
|
||||
while (it.hasNext()) {
|
||||
HPMedia hPMedia = (HPMedia) it.next();
|
||||
for (HPMedia hPMedia2 : AlbumActivity.m) {
|
||||
if (hPMedia.getId() == hPMedia2.getId() || hPMedia.getPath().equals(hPMedia2.getPath())) {
|
||||
hPMedia2.setSelected(true);
|
||||
arrayList2.add(hPMedia2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
AlbumActivity.this.f.clear();
|
||||
AlbumActivity.this.f.addAll(arrayList2);
|
||||
final ArrayList arrayList3 = new ArrayList();
|
||||
for (HPMedia hPMedia3 : AlbumActivity.n) {
|
||||
if (((HPVideo) hPMedia3).getDuration() < 500) {
|
||||
arrayList3.add(hPMedia3);
|
||||
} else {
|
||||
HPVideo.getVideoThumnail(AlbumActivity.this, hPMedia3);
|
||||
}
|
||||
}
|
||||
AlbumActivity.this.l.post(new Runnable() { // from class: com.bottle.hp.album.selector.AlbumActivity.3.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
AlbumActivity.n.removeAll(arrayList3);
|
||||
AlbumActivity.this.e.removeAll(arrayList3);
|
||||
AlbumActivity.this.d.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.k = getString(R$string.done);
|
||||
this.i = (ImageView) findViewById(R$id.imgBack);
|
||||
this.i.setOnClickListener(this);
|
||||
this.j = (Button) findViewById(R$id.btnCompleted);
|
||||
this.j.setOnClickListener(this);
|
||||
this.c = (GridView) findViewById(R$id.gridView);
|
||||
this.c.setOnItemClickListener(this);
|
||||
this.h = getIntent().getIntExtra(FileDownloadModel.TOTAL, 5);
|
||||
this.g = getIntent().getIntExtra("type", 5);
|
||||
}
|
||||
|
||||
public HPMedia E0() {
|
||||
HPMedia hPMedia = new HPMedia();
|
||||
hPMedia.setId(Integer.MAX_VALUE);
|
||||
hPMedia.setModifyDate("2147483647");
|
||||
return hPMedia;
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
if (i == 101) {
|
||||
a(i2, intent);
|
||||
} else if (i == 102) {
|
||||
b(i2, intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R$id.imgBack) {
|
||||
e(false);
|
||||
} else if (id == R$id.btnCompleted) {
|
||||
e(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
this.l = new Handler() { // from class: com.bottle.hp.album.selector.AlbumActivity.1
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
int i = message.what;
|
||||
if (i == 201) {
|
||||
AlbumActivity.this.a(message);
|
||||
} else if (i == 202) {
|
||||
AlbumActivity.this.F0();
|
||||
}
|
||||
}
|
||||
};
|
||||
setContentView(R$layout.activity_album);
|
||||
initView();
|
||||
if (Build.VERSION.SDK_INT < 23 || ContextCompat.a(this, "android.permission.READ_EXTERNAL_STORAGE") == 0) {
|
||||
initData();
|
||||
} else {
|
||||
JimuPermissionRequest.c(this, new PermissionRequestListener() { // from class: com.bottle.hp.album.selector.AlbumActivity.2
|
||||
@Override // com.ubtech.permission.PermissionRequestListener
|
||||
public void onDenied() {
|
||||
AlbumActivity.this.finish();
|
||||
}
|
||||
|
||||
@Override // com.ubtech.permission.PermissionRequestListener
|
||||
public void onGranted() {
|
||||
AlbumActivity.this.initData();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onDestroy() {
|
||||
this.l.removeCallbacksAndMessages(null);
|
||||
this.l = null;
|
||||
m.clear();
|
||||
n.clear();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override // android.widget.AdapterView.OnItemClickListener
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
|
||||
if (i != 0) {
|
||||
HPMedia hPMedia = this.e.get(i);
|
||||
if (hPMedia.getMediaType() == 0) {
|
||||
AlbumActivity2.a(this, 101, this.h, a(hPMedia, m), 0, this.f);
|
||||
return;
|
||||
} else if (this.f.size() > 0) {
|
||||
b(R$string.tips_type_limit, 0);
|
||||
return;
|
||||
} else {
|
||||
if (((HPVideo) hPMedia).getDuration() > 20500) {
|
||||
return;
|
||||
}
|
||||
AlbumActivity2.a(this, 101, this.h, a(hPMedia, n), 1, this.f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.f.size() == this.h) {
|
||||
a(getString(R$string.number_limit), 0);
|
||||
return;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 23) {
|
||||
int i2 = this.g;
|
||||
if (i2 == 5) {
|
||||
i2 = this.f.size() == 0 ? 5 : 1;
|
||||
}
|
||||
VideoCaptureActivity.a(this, 102, i2);
|
||||
return;
|
||||
}
|
||||
if (ContextCompat.a(this, "android.permission.CAMERA") != 0) {
|
||||
JimuPermissionRequest.a((Context) this, new PermissionRequestListener() { // from class: com.bottle.hp.album.selector.AlbumActivity.4
|
||||
@Override // com.ubtech.permission.PermissionRequestListener
|
||||
public void onDenied() {
|
||||
}
|
||||
|
||||
@Override // com.ubtech.permission.PermissionRequestListener
|
||||
public void onGranted() {
|
||||
AlbumActivity albumActivity = AlbumActivity.this;
|
||||
int i3 = 5;
|
||||
if (albumActivity.g != 5) {
|
||||
i3 = AlbumActivity.this.g;
|
||||
} else if (AlbumActivity.this.f.size() != 0) {
|
||||
i3 = 1;
|
||||
}
|
||||
VideoCaptureActivity.a(albumActivity, 102, i3);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
int i3 = this.g;
|
||||
if (i3 == 5) {
|
||||
i3 = this.f.size() == 0 ? 5 : 1;
|
||||
}
|
||||
VideoCaptureActivity.a(this, 102, i3);
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (i != 4) {
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
e(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void b(int i, Intent intent) {
|
||||
if (i == 0) {
|
||||
return;
|
||||
}
|
||||
String stringExtra = intent.getStringExtra("data");
|
||||
if (!TextUtils.isEmpty(stringExtra) && new File(stringExtra).exists()) {
|
||||
int intExtra = intent.getIntExtra("data_type", -1);
|
||||
if (1 == intExtra) {
|
||||
HPVideo searchVideoByName = HPVideo.searchVideoByName(this, stringExtra);
|
||||
if (searchVideoByName == null) {
|
||||
searchVideoByName = new HPVideo();
|
||||
searchVideoByName.setPath(stringExtra);
|
||||
searchVideoByName.setMediaType(intExtra);
|
||||
searchVideoByName.setSize(new File(stringExtra).length());
|
||||
searchVideoByName.setDuration(HPVideo.getVideoDuration(stringExtra));
|
||||
}
|
||||
HPVideo.getVideoThumnail(this, searchVideoByName);
|
||||
this.f.clear();
|
||||
this.f.add(searchVideoByName);
|
||||
} else {
|
||||
HPMedia searchImageByName = HPImage.searchImageByName(this, stringExtra);
|
||||
if (searchImageByName == null) {
|
||||
searchImageByName = new HPImage();
|
||||
searchImageByName.setId(0);
|
||||
searchImageByName.setPath(stringExtra);
|
||||
searchImageByName.setPreview(stringExtra);
|
||||
}
|
||||
this.f.add(searchImageByName);
|
||||
}
|
||||
e(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void e(boolean z) {
|
||||
Intent intent = new Intent();
|
||||
if (z) {
|
||||
intent.putExtra("result_data", this.f);
|
||||
setResult(-1, intent);
|
||||
} else {
|
||||
setResult(0, intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
public static void a(Activity activity, int i, int i2, ArrayList<HPMedia> arrayList, int i3) {
|
||||
Intent intent = new Intent(activity, (Class<?>) AlbumActivity.class);
|
||||
intent.putExtra(FileDownloadModel.TOTAL, i2);
|
||||
intent.putExtra("input_selected", arrayList);
|
||||
intent.putExtra("type", i3);
|
||||
activity.startActivityForResult(intent, i);
|
||||
}
|
||||
|
||||
private void a(int i, Intent intent) {
|
||||
int indexOf;
|
||||
if (i == 0) {
|
||||
return;
|
||||
}
|
||||
List list = (List) intent.getSerializableExtra("selected");
|
||||
int intExtra = intent.getIntExtra("current", 0);
|
||||
int intExtra2 = intent.getIntExtra("type", -1);
|
||||
boolean booleanExtra = intent.getBooleanExtra("done", false);
|
||||
if (list == null) {
|
||||
list = new ArrayList();
|
||||
this.j.setEnabled(false);
|
||||
} else if (list.size() > 0) {
|
||||
this.j.setEnabled(true);
|
||||
} else {
|
||||
this.j.setEnabled(false);
|
||||
}
|
||||
this.f.clear();
|
||||
this.f.addAll(list);
|
||||
if (intExtra2 == 1) {
|
||||
if (list.size() > 0) {
|
||||
e(true);
|
||||
return;
|
||||
} else {
|
||||
indexOf = this.e.indexOf(n.get(intExtra));
|
||||
}
|
||||
} else {
|
||||
indexOf = this.e.indexOf(m.get(intExtra));
|
||||
}
|
||||
if (booleanExtra) {
|
||||
e(true);
|
||||
return;
|
||||
}
|
||||
Message message = new Message();
|
||||
message.what = 201;
|
||||
message.arg1 = indexOf;
|
||||
this.l.sendMessage(message);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public void a(Message message) {
|
||||
this.d.notifyDataSetChanged();
|
||||
this.c.smoothScrollToPosition(message.arg1);
|
||||
if (this.f.size() > 0) {
|
||||
this.j.setText(this.k + "(" + this.f.size() + "/" + this.h + ")");
|
||||
return;
|
||||
}
|
||||
this.j.setText(this.k);
|
||||
}
|
||||
|
||||
private int a(HPMedia hPMedia, List<HPMedia> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
if (hPMedia.getId() == list.get(i).getId()) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
262
sources/com/bottle/hp/album/selector/AlbumActivity2.java
Normal file
262
sources/com/bottle/hp/album/selector/AlbumActivity2.java
Normal file
@@ -0,0 +1,262 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import com.bottle.hp.album.BaseActivity;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.R$string;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.capture.VideoPreviewActivity;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import com.bottle.hp.album.media.HPVideo;
|
||||
import com.bottle.hp.album.photoview.HackyViewPager;
|
||||
import com.bottle.hp.album.selector.AlbumAdapter2;
|
||||
import com.liulishuo.filedownloader.model.FileDownloadModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlbumActivity2 extends BaseActivity implements View.OnClickListener, ViewPager.OnPageChangeListener, AlbumAdapter2.IPhotoViewUIListener {
|
||||
private RelativeLayout c;
|
||||
private ImageView d;
|
||||
private TextView e;
|
||||
private Button f;
|
||||
private CheckBox g;
|
||||
private HackyViewPager h;
|
||||
private AlbumAdapter2 i;
|
||||
private ImageView j;
|
||||
private List<HPMedia> k;
|
||||
private List<HPMedia> l;
|
||||
private int m;
|
||||
private int n;
|
||||
private int o;
|
||||
private String p;
|
||||
private ObjectAnimator q;
|
||||
private ObjectAnimator r;
|
||||
|
||||
private void E0() {
|
||||
HPMedia hPMedia = this.k.get(this.h.getCurrentItem());
|
||||
if (this.l.size() >= this.m && !hPMedia.isSelected()) {
|
||||
this.g.setChecked(false);
|
||||
a(String.format(getString(R$string.number_limit), this.m + ""), 0);
|
||||
return;
|
||||
}
|
||||
if (this.g.isChecked()) {
|
||||
this.l.add(hPMedia);
|
||||
hPMedia.setSelected(true);
|
||||
} else {
|
||||
Iterator<HPMedia> it = this.l.iterator();
|
||||
while (true) {
|
||||
if (!it.hasNext()) {
|
||||
break;
|
||||
}
|
||||
HPMedia next = it.next();
|
||||
if (hPMedia.getId() == next.getId()) {
|
||||
this.l.remove(next);
|
||||
break;
|
||||
}
|
||||
}
|
||||
hPMedia.setSelected(false);
|
||||
}
|
||||
if (this.l.size() <= 0) {
|
||||
this.f.setEnabled(false);
|
||||
this.f.setText(this.p);
|
||||
return;
|
||||
}
|
||||
this.f.setEnabled(true);
|
||||
this.f.setText(this.p + "(" + this.l.size() + "/" + this.m + ")");
|
||||
}
|
||||
|
||||
public static void a(Activity activity, int i, int i2, int i3, int i4, ArrayList<HPMedia> arrayList) {
|
||||
Intent intent = new Intent(activity, (Class<?>) AlbumActivity2.class);
|
||||
intent.putExtra(FileDownloadModel.TOTAL, i2);
|
||||
intent.putExtra("mediaType", i4);
|
||||
intent.putExtra("selected", arrayList);
|
||||
intent.putExtra("current", i3);
|
||||
activity.startActivityForResult(intent, i);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
this.p = "";
|
||||
Intent intent = getIntent();
|
||||
this.m = intent.getIntExtra(FileDownloadModel.TOTAL, 0);
|
||||
this.n = intent.getIntExtra("mediaType", -1);
|
||||
this.o = intent.getIntExtra("current", 0);
|
||||
this.k = new ArrayList();
|
||||
if (this.n == 1) {
|
||||
List<HPMedia> list = AlbumActivity.n;
|
||||
if (list != null) {
|
||||
this.k.addAll(list);
|
||||
}
|
||||
} else {
|
||||
List<HPMedia> list2 = AlbumActivity.m;
|
||||
if (list2 != null) {
|
||||
this.k.addAll(list2);
|
||||
}
|
||||
}
|
||||
this.l = (List) intent.getSerializableExtra("selected");
|
||||
this.i = new AlbumAdapter2(this, this.k, this.l, this.n, this);
|
||||
this.h.setAdapter(this.i);
|
||||
this.h.setCurrentItem(this.o);
|
||||
if (this.k.get(this.o).isSelected()) {
|
||||
this.g.setChecked(true);
|
||||
} else {
|
||||
this.g.setChecked(false);
|
||||
}
|
||||
this.e.setText((this.o + 1) + "/" + this.k.size());
|
||||
List<HPMedia> list3 = this.l;
|
||||
if (list3 == null || list3.size() <= 0) {
|
||||
this.f.setEnabled(false);
|
||||
this.l = new ArrayList();
|
||||
this.f.setText(this.p);
|
||||
} else {
|
||||
this.f.setEnabled(true);
|
||||
this.f.setText(this.p + "(" + this.l.size() + "/" + this.m + ")");
|
||||
}
|
||||
if (this.n == 1) {
|
||||
this.g.setVisibility(8);
|
||||
this.f.setVisibility(8);
|
||||
this.j.setVisibility(0);
|
||||
} else {
|
||||
this.g.setVisibility(0);
|
||||
this.f.setVisibility(0);
|
||||
this.j.setVisibility(8);
|
||||
}
|
||||
this.q = ObjectAnimator.ofFloat(this.c, "translationY", -Utils.a(this, 48.0f), 0.0f);
|
||||
this.q.setDuration(200L);
|
||||
this.r = ObjectAnimator.ofFloat(this.c, "translationY", 0.0f, -Utils.a(this, 48.0f));
|
||||
this.r.setDuration(200L);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.c = (RelativeLayout) findViewById(R$id.rlActionBar);
|
||||
this.d = (ImageView) findViewById(R$id.imgBack);
|
||||
this.e = (TextView) findViewById(R$id.tvCurrent);
|
||||
this.f = (Button) findViewById(R$id.btnCompleted);
|
||||
this.g = (CheckBox) findViewById(R$id.cbChoose);
|
||||
this.h = (HackyViewPager) findViewById(R$id.hackyViewPager);
|
||||
this.j = (ImageView) findViewById(R$id.imgSelectVideo);
|
||||
this.f.setOnClickListener(this);
|
||||
this.g.setOnClickListener(this);
|
||||
this.d.setOnClickListener(this);
|
||||
this.h.setOnPageChangeListener(this);
|
||||
this.j.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.selector.AlbumAdapter2.IPhotoViewUIListener
|
||||
public void a(HPMedia hPMedia) {
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.selector.AlbumAdapter2.IPhotoViewUIListener
|
||||
public void b(HPMedia hPMedia) {
|
||||
VideoPreviewActivity.a(this, 101, hPMedia.getPath());
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onActivityResult(int i, int i2, Intent intent) {
|
||||
super.onActivityResult(i, i2, intent);
|
||||
if (i == 101 && i2 == -1) {
|
||||
a(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R$id.imgBack) {
|
||||
a(true, false);
|
||||
return;
|
||||
}
|
||||
if (id == R$id.btnCompleted) {
|
||||
return;
|
||||
}
|
||||
if (id == R$id.cbChoose) {
|
||||
E0();
|
||||
return;
|
||||
}
|
||||
if (id == R$id.imgSelectVideo) {
|
||||
HPMedia hPMedia = this.k.get(this.h.getCurrentItem());
|
||||
HPVideo hPVideo = hPMedia instanceof HPVideo ? (HPVideo) hPMedia : null;
|
||||
if (hPVideo == null || hPVideo.getDuration() <= 20499) {
|
||||
a(true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_album2);
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (i != 4) {
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
a(true, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrollStateChanged(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrolled(int i, float f, int i2) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageSelected(int i) {
|
||||
HPMedia hPMedia = this.k.get(i);
|
||||
if (hPMedia.isSelected()) {
|
||||
this.g.setChecked(true);
|
||||
} else {
|
||||
this.g.setChecked(false);
|
||||
}
|
||||
this.e.setText((i + 1) + "/" + this.k.size());
|
||||
if (hPMedia instanceof HPVideo) {
|
||||
if (((HPVideo) hPMedia).getDuration() > 20499) {
|
||||
this.j.setEnabled(false);
|
||||
} else {
|
||||
this.j.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
private void a(boolean z, boolean z2) {
|
||||
if (this.n == 1 && z2) {
|
||||
this.l.add(this.k.get(this.h.getCurrentItem()));
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("selected", (ArrayList) this.l);
|
||||
intent.putExtra("current", this.h.getCurrentItem());
|
||||
intent.putExtra("type", this.n);
|
||||
intent.putExtra("done", z2);
|
||||
if (z) {
|
||||
setResult(-1, intent);
|
||||
} else {
|
||||
setResult(0, intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
}
|
149
sources/com/bottle/hp/album/selector/AlbumAdapter.java
Normal file
149
sources/com/bottle/hp/album/selector/AlbumAdapter.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.R$mipmap;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import com.bottle.hp.album.media.HPVideo;
|
||||
import com.bumptech.glide.Glide;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlbumAdapter extends BaseAdapter {
|
||||
private List<HPMedia> a;
|
||||
private Context b;
|
||||
private IAlbumAdapterUIListener c;
|
||||
|
||||
public interface IAlbumAdapterUIListener {
|
||||
void a(CompoundButton compoundButton, boolean z, HPMedia hPMedia);
|
||||
}
|
||||
|
||||
private class ViewHolder {
|
||||
public ImageView a;
|
||||
public CheckBox b;
|
||||
public RelativeLayout c;
|
||||
public TextView d;
|
||||
public TextView e;
|
||||
public ImageView f;
|
||||
|
||||
private ViewHolder(AlbumAdapter albumAdapter) {
|
||||
}
|
||||
}
|
||||
|
||||
public AlbumAdapter(Context context, List<HPMedia> list, IAlbumAdapterUIListener iAlbumAdapterUIListener) {
|
||||
this.b = context;
|
||||
this.a = list;
|
||||
this.c = iAlbumAdapterUIListener;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public int getCount() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public Object getItem(int i) {
|
||||
return this.a.get(i);
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override // android.widget.Adapter
|
||||
@SuppressLint({"InflateParams"})
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
View view2;
|
||||
final ViewHolder viewHolder;
|
||||
if (view == null) {
|
||||
viewHolder = new ViewHolder();
|
||||
view2 = LayoutInflater.from(this.b).inflate(R$layout.adapter_album, (ViewGroup) null);
|
||||
viewHolder.a = (ImageView) view2.findViewById(R$id.adapter_gallery_item_img_snapshoot);
|
||||
viewHolder.b = (CheckBox) view2.findViewById(R$id.adapter_gallery_item_cb_selected);
|
||||
viewHolder.c = (RelativeLayout) view2.findViewById(R$id.llVideo);
|
||||
viewHolder.d = (TextView) view2.findViewById(R$id.tvDuration);
|
||||
viewHolder.e = (TextView) view2.findViewById(R$id.tvCapture);
|
||||
viewHolder.f = (ImageView) view2.findViewById(R$id.imgMask);
|
||||
view2.setTag(viewHolder);
|
||||
} else {
|
||||
view2 = view;
|
||||
viewHolder = (ViewHolder) view.getTag();
|
||||
}
|
||||
if (i == 0) {
|
||||
viewHolder.f.setVisibility(8);
|
||||
viewHolder.c.setVisibility(8);
|
||||
viewHolder.b.setVisibility(8);
|
||||
viewHolder.e.setVisibility(8);
|
||||
viewHolder.a.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
|
||||
viewHolder.a.setImageResource(R$mipmap.camera);
|
||||
return view2;
|
||||
}
|
||||
viewHolder.b.setVisibility(0);
|
||||
viewHolder.e.setVisibility(8);
|
||||
final HPMedia hPMedia = this.a.get(i);
|
||||
if (1 == hPMedia.getMediaType()) {
|
||||
HPVideo hPVideo = (HPVideo) hPMedia;
|
||||
viewHolder.b.setVisibility(8);
|
||||
viewHolder.c.setVisibility(0);
|
||||
if (hPVideo.getDuration() <= 0) {
|
||||
hPVideo.setDuration(MediaPlayer.create(this.b, Uri.parse(hPVideo.getPath())) != null ? r4.getDuration() : 0L);
|
||||
}
|
||||
viewHolder.d.setText(Utils.a(hPVideo.getDuration() + 500));
|
||||
if (hPVideo.getDuration() > 20499) {
|
||||
viewHolder.f.setVisibility(0);
|
||||
} else {
|
||||
viewHolder.f.setVisibility(8);
|
||||
}
|
||||
} else {
|
||||
viewHolder.f.setVisibility(8);
|
||||
viewHolder.b.setVisibility(0);
|
||||
viewHolder.c.setVisibility(8);
|
||||
}
|
||||
if (hPMedia.getMediaType() == 0) {
|
||||
Glide.e(this.b).a(hPMedia.getPreview()).a(viewHolder.a);
|
||||
} else if (TextUtils.isEmpty(hPMedia.getPreview())) {
|
||||
Bitmap a = Utils.a(this.b.getContentResolver(), hPMedia.getPath(), 3);
|
||||
viewHolder.a.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
if (a != null) {
|
||||
viewHolder.a.setImageBitmap(a);
|
||||
} else {
|
||||
viewHolder.a.setImageResource(R$mipmap.load_failed);
|
||||
}
|
||||
} else {
|
||||
Glide.e(this.b).a(hPMedia.getPreview()).a(viewHolder.a);
|
||||
}
|
||||
viewHolder.b.setOnClickListener(new View.OnClickListener() { // from class: com.bottle.hp.album.selector.AlbumAdapter.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view3) {
|
||||
if (AlbumAdapter.this.c != null) {
|
||||
IAlbumAdapterUIListener iAlbumAdapterUIListener = AlbumAdapter.this.c;
|
||||
CheckBox checkBox = viewHolder.b;
|
||||
iAlbumAdapterUIListener.a(checkBox, checkBox.isChecked(), hPMedia);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (hPMedia.isSelected()) {
|
||||
viewHolder.b.setChecked(true);
|
||||
} else {
|
||||
viewHolder.b.setChecked(false);
|
||||
}
|
||||
return view2;
|
||||
}
|
||||
}
|
94
sources/com/bottle/hp/album/selector/AlbumAdapter2.java
Normal file
94
sources/com/bottle/hp/album/selector/AlbumAdapter2.java
Normal file
@@ -0,0 +1,94 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.ThumbnailUtils;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.chrisbanes.photoview.PhotoView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class AlbumAdapter2 extends PagerAdapter {
|
||||
private List<HPMedia> a;
|
||||
private IPhotoViewUIListener b;
|
||||
private Context c;
|
||||
|
||||
public interface IPhotoViewUIListener {
|
||||
void a(HPMedia hPMedia);
|
||||
|
||||
void b(HPMedia hPMedia);
|
||||
}
|
||||
|
||||
public AlbumAdapter2(Context context, List<HPMedia> list, List<HPMedia> list2, int i, IPhotoViewUIListener iPhotoViewUIListener) {
|
||||
list = list == null ? new ArrayList<>() : list;
|
||||
if (list2 == null) {
|
||||
new ArrayList();
|
||||
}
|
||||
this.b = iPhotoViewUIListener;
|
||||
this.a = list;
|
||||
this.c = context;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
viewGroup.removeView((View) obj);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public int getCount() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public boolean isViewFromObject(View view, Object obj) {
|
||||
return view == obj;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public View instantiateItem(ViewGroup viewGroup, int i) {
|
||||
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R$layout.adapter_album2, (ViewGroup) null);
|
||||
PhotoView photoView = (PhotoView) inflate.findViewById(R$id.photoView);
|
||||
photoView.setMaximumScale(8.0f);
|
||||
ImageView imageView = (ImageView) inflate.findViewById(R$id.imgPlay);
|
||||
final HPMedia hPMedia = this.a.get(i);
|
||||
if (hPMedia.getMediaType() == 0) {
|
||||
Glide.e(this.c).a(hPMedia.getPreview()).a((ImageView) photoView);
|
||||
imageView.setVisibility(8);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(hPMedia.getPreview())) {
|
||||
photoView.setScaleType(ImageView.ScaleType.FIT_CENTER);
|
||||
photoView.setImageBitmap(ThumbnailUtils.createVideoThumbnail(hPMedia.getPath(), 1));
|
||||
} else {
|
||||
Glide.e(this.c).a(hPMedia.getPreview()).a((ImageView) photoView);
|
||||
}
|
||||
imageView.setVisibility(0);
|
||||
}
|
||||
photoView.setOnClickListener(new View.OnClickListener() { // from class: com.bottle.hp.album.selector.AlbumAdapter2.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (AlbumAdapter2.this.b != null) {
|
||||
AlbumAdapter2.this.b.a(hPMedia);
|
||||
}
|
||||
}
|
||||
});
|
||||
imageView.setOnClickListener(new View.OnClickListener() { // from class: com.bottle.hp.album.selector.AlbumAdapter2.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (AlbumAdapter2.this.b != null) {
|
||||
AlbumAdapter2.this.b.b(hPMedia);
|
||||
}
|
||||
}
|
||||
});
|
||||
viewGroup.addView(inflate, -1, -1);
|
||||
return inflate;
|
||||
}
|
||||
}
|
54
sources/com/bottle/hp/album/selector/HPMediaComparator.java
Normal file
54
sources/com/bottle/hp/album/selector/HPMediaComparator.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import java.util.Comparator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class HPMediaComparator implements Comparator<HPMedia> {
|
||||
@Override // java.util.Comparator
|
||||
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
||||
public int compare(HPMedia hPMedia, HPMedia hPMedia2) {
|
||||
String str;
|
||||
if (hPMedia == null && hPMedia2 == null) {
|
||||
return 0;
|
||||
}
|
||||
if (hPMedia == null) {
|
||||
return 1;
|
||||
}
|
||||
if (hPMedia2 == null) {
|
||||
return -1;
|
||||
}
|
||||
String str2 = null;
|
||||
try {
|
||||
str = hPMedia.getModifyDate();
|
||||
} catch (Exception unused) {
|
||||
str = null;
|
||||
}
|
||||
try {
|
||||
str2 = hPMedia2.getModifyDate();
|
||||
} catch (Exception unused2) {
|
||||
}
|
||||
if (str == null) {
|
||||
return 1;
|
||||
}
|
||||
if (str2 == null) {
|
||||
return -1;
|
||||
}
|
||||
if (str.equals(str2)) {
|
||||
return 0;
|
||||
}
|
||||
if (!Utils.b(str) || !Utils.b(str2)) {
|
||||
if (Utils.b(str) || Utils.b(str2)) {
|
||||
return !Utils.b(str) ? 1 : -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
long parseLong = Long.parseLong(hPMedia.getModifyDate());
|
||||
long parseLong2 = Long.parseLong(hPMedia2.getModifyDate());
|
||||
if (parseLong == parseLong2) {
|
||||
return 0;
|
||||
}
|
||||
return parseLong > parseLong2 ? -1 : 1;
|
||||
}
|
||||
}
|
216
sources/com/bottle/hp/album/selector/PhotoEditorActivity.java
Normal file
216
sources/com/bottle/hp/album/selector/PhotoEditorActivity.java
Normal file
@@ -0,0 +1,216 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Intent;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.capture.VideoPlayFragment;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import com.bottle.hp.album.photoview.HackyViewPager;
|
||||
import com.bottle.hp.album.selector.PhotoEditorAdapter;
|
||||
import com.ubtrobot.log.ALog;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PhotoEditorActivity extends AppCompatActivity implements View.OnClickListener, PhotoEditorAdapter.IPhotoViewUIListener, ViewPager.OnPageChangeListener, VideoPlayFragment.IPlayListener {
|
||||
private final String a = PhotoEditorActivity.class.getSimpleName();
|
||||
private HackyViewPager b;
|
||||
private RelativeLayout c;
|
||||
private ImageView d;
|
||||
private TextView e;
|
||||
private ImageView f;
|
||||
private RelativeLayout g;
|
||||
private PhotoEditorAdapter h;
|
||||
private List<HPMedia> i;
|
||||
private VideoPlayFragment j;
|
||||
private ObjectAnimator k;
|
||||
private ObjectAnimator l;
|
||||
|
||||
private void D0() {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("result_data", (ArrayList) this.i);
|
||||
setResult(-1, intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
private void E0() {
|
||||
int currentItem = this.b.getCurrentItem();
|
||||
this.i.remove(currentItem);
|
||||
if (this.i.size() == 0) {
|
||||
this.h.notifyDataSetChanged();
|
||||
D0();
|
||||
return;
|
||||
}
|
||||
if (currentItem >= this.i.size() - 1) {
|
||||
currentItem = this.i.size() - 1;
|
||||
}
|
||||
this.e.setText((currentItem + 1) + "/" + this.i.size());
|
||||
this.h = new PhotoEditorAdapter(this, this.i, this);
|
||||
this.b.setAdapter(this.h);
|
||||
this.h.notifyDataSetChanged();
|
||||
this.b.setCurrentItem(currentItem);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
Intent intent = getIntent();
|
||||
this.i = (List) intent.getSerializableExtra("medias");
|
||||
final int intExtra = intent.getIntExtra("current", 0);
|
||||
this.h = new PhotoEditorAdapter(this, this.i, this);
|
||||
this.b.setAdapter(this.h);
|
||||
this.b.postDelayed(new Runnable() { // from class: com.bottle.hp.album.selector.PhotoEditorActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
PhotoEditorActivity.this.b.setCurrentItem(intExtra);
|
||||
}
|
||||
}, 20L);
|
||||
this.e.setText((intExtra + 1) + "/" + this.i.size());
|
||||
this.k = ObjectAnimator.ofFloat(this.c, "translationY", (float) (-Utils.a(this, 48.0f)), 0.0f);
|
||||
this.k.setDuration(200L);
|
||||
this.l = ObjectAnimator.ofFloat(this.c, "translationY", 0.0f, (float) (-Utils.a(this, 48.0f)));
|
||||
this.l.setDuration(200L);
|
||||
this.j = VideoPlayFragment.a(null, false, true);
|
||||
getFragmentManager().beginTransaction().replace(R$id.rlVideoViewContainer, this.j).commit();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
this.b = (HackyViewPager) findViewById(R$id.hackyViewPager);
|
||||
this.c = (RelativeLayout) findViewById(R$id.rlActionBar);
|
||||
this.d = (ImageView) findViewById(R$id.imgBack);
|
||||
this.e = (TextView) findViewById(R$id.tvCurrent);
|
||||
this.f = (ImageView) findViewById(R$id.imgDelete);
|
||||
this.g = (RelativeLayout) findViewById(R$id.rlVideoViewContainer);
|
||||
this.d.setOnClickListener(this);
|
||||
this.f.setOnClickListener(this);
|
||||
this.b.setOnPageChangeListener(this);
|
||||
this.g.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void m0() {
|
||||
this.c.setVisibility(0);
|
||||
this.k.start();
|
||||
}
|
||||
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R$id.imgBack) {
|
||||
D0();
|
||||
} else if (id == R$id.imgDelete) {
|
||||
E0();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R$layout.activity_photo_editor);
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void onFinished() {
|
||||
this.b.setVisibility(0);
|
||||
this.g.setVisibility(8);
|
||||
this.c.setVisibility(0);
|
||||
this.k.start();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // androidx.appcompat.app.AppCompatActivity, android.app.Activity, android.view.KeyEvent.Callback
|
||||
public boolean onKeyDown(int i, KeyEvent keyEvent) {
|
||||
if (i != 4) {
|
||||
return super.onKeyDown(i, keyEvent);
|
||||
}
|
||||
D0();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrollStateChanged(int i) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageScrolled(int i, float f, int i2) {
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
public void onPageSelected(int i) {
|
||||
this.e.setText((i + 1) + "/" + this.i.size());
|
||||
}
|
||||
|
||||
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
VideoPlayFragment videoPlayFragment = this.j;
|
||||
if (videoPlayFragment != null) {
|
||||
videoPlayFragment.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void onProgress(int i, int i2, int i3) {
|
||||
ALog.a(this.a).d("progress:" + i3);
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void v0() {
|
||||
this.b.setVisibility(8);
|
||||
this.g.setVisibility(0);
|
||||
this.c.postDelayed(new Runnable() { // from class: com.bottle.hp.album.selector.PhotoEditorActivity.3
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
PhotoEditorActivity.this.c.setVisibility(8);
|
||||
}
|
||||
}, 200L);
|
||||
this.l.start();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.selector.PhotoEditorAdapter.IPhotoViewUIListener
|
||||
public void a(HPMedia hPMedia) {
|
||||
if (this.c.getVisibility() == 0) {
|
||||
this.c.postDelayed(new Runnable() { // from class: com.bottle.hp.album.selector.PhotoEditorActivity.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
PhotoEditorActivity.this.c.setVisibility(8);
|
||||
}
|
||||
}, 200L);
|
||||
this.l.start();
|
||||
} else {
|
||||
this.c.setVisibility(0);
|
||||
this.k.start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.selector.PhotoEditorAdapter.IPhotoViewUIListener
|
||||
public void b(HPMedia hPMedia) {
|
||||
this.g.setVisibility(0);
|
||||
this.b.setVisibility(8);
|
||||
this.j.a(Uri.fromFile(new File(hPMedia.getPath())));
|
||||
this.j.b();
|
||||
}
|
||||
|
||||
@Override // com.bottle.hp.album.capture.VideoPlayFragment.IPlayListener
|
||||
public void b(String str) {
|
||||
Log.e(this.a, str);
|
||||
}
|
||||
}
|
93
sources/com/bottle/hp/album/selector/PhotoEditorAdapter.java
Normal file
93
sources/com/bottle/hp/album/selector/PhotoEditorAdapter.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.bottle.hp.album.selector;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import com.bottle.hp.album.R$id;
|
||||
import com.bottle.hp.album.R$layout;
|
||||
import com.bottle.hp.album.Utils;
|
||||
import com.bottle.hp.album.media.HPMedia;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.github.chrisbanes.photoview.PhotoView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PhotoEditorAdapter extends PagerAdapter {
|
||||
private List<HPMedia> a;
|
||||
private IPhotoViewUIListener b;
|
||||
private Context c;
|
||||
|
||||
public interface IPhotoViewUIListener {
|
||||
void a(HPMedia hPMedia);
|
||||
|
||||
void b(HPMedia hPMedia);
|
||||
}
|
||||
|
||||
public PhotoEditorAdapter(Context context, List<HPMedia> list, IPhotoViewUIListener iPhotoViewUIListener) {
|
||||
this.c = context;
|
||||
list = list == null ? new ArrayList<>() : list;
|
||||
this.b = iPhotoViewUIListener;
|
||||
this.a = list;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public void destroyItem(ViewGroup viewGroup, int i, Object obj) {
|
||||
viewGroup.removeView((View) obj);
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public int getCount() {
|
||||
return this.a.size();
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public boolean isViewFromObject(View view, Object obj) {
|
||||
return view == obj;
|
||||
}
|
||||
|
||||
@Override // androidx.viewpager.widget.PagerAdapter
|
||||
public View instantiateItem(ViewGroup viewGroup, int i) {
|
||||
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R$layout.adapter_photo_eidtor, (ViewGroup) null);
|
||||
PhotoView photoView = (PhotoView) inflate.findViewById(R$id.photoView);
|
||||
ImageView imageView = (ImageView) inflate.findViewById(R$id.imgPlay);
|
||||
photoView.setMaximumScale(8.0f);
|
||||
final HPMedia hPMedia = this.a.get(i);
|
||||
if (1 == hPMedia.getMediaType()) {
|
||||
imageView.setVisibility(0);
|
||||
if (TextUtils.isEmpty(hPMedia.getPreview())) {
|
||||
Bitmap a = Utils.a(this.c.getContentResolver(), hPMedia.getPath(), 1);
|
||||
photoView.setScaleType(ImageView.ScaleType.FIT_CENTER);
|
||||
photoView.setImageBitmap(a);
|
||||
} else {
|
||||
Glide.e(this.c).a(hPMedia.getPreview()).a((ImageView) photoView);
|
||||
}
|
||||
} else {
|
||||
imageView.setVisibility(8);
|
||||
Glide.e(this.c).a(hPMedia.getPreview()).a((ImageView) photoView);
|
||||
}
|
||||
photoView.setOnClickListener(new View.OnClickListener() { // from class: com.bottle.hp.album.selector.PhotoEditorAdapter.1
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (PhotoEditorAdapter.this.b != null) {
|
||||
PhotoEditorAdapter.this.b.a(hPMedia);
|
||||
}
|
||||
}
|
||||
});
|
||||
imageView.setOnClickListener(new View.OnClickListener() { // from class: com.bottle.hp.album.selector.PhotoEditorAdapter.2
|
||||
@Override // android.view.View.OnClickListener
|
||||
public void onClick(View view) {
|
||||
if (PhotoEditorAdapter.this.b != null) {
|
||||
PhotoEditorAdapter.this.b.b(hPMedia);
|
||||
}
|
||||
}
|
||||
});
|
||||
viewGroup.addView(inflate, -1, -1);
|
||||
return inflate;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user