layout
1)activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MainActivity" > <Button android:id="@+id/close" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/start_float_window" android:layout_centerHorizontal="true" android:layout_marginTop="80dp" android:text="关闭录屏功能" /> <Button android:id="@+id/start_float_window" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="260dp" android:text="开启录屏功能" /> <Button android:id="@+id/settings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:text="设置" /> </RelativeLayout>
2)control_notification.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/status_bar_latest_event_content" android:layout_width="match_parent" android:layout_height="64dp" android:background="#fafafa" android:descendantFocusability="blocksDescendants" > <ImageView android:id="@+id/left_icon" android:layout_width="40dp" android:layout_height="40dp" android:layout_alignParentLeft="true" android:layout_centerInParent="true" android:layout_centerVertical="true" android:layout_marginLeft="12dp" android:layout_marginRight="12dp" android:src="@drawable/icon_pull_down_bar" /> <ImageView android:id="@+id/pause_button" android:layout_width="30dp" android:layout_height="30dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="50px" android:gravity="center" android:src="@drawable/pull_down_bar_black_suspend" /> <ImageView android:id="@+id/stop_button" android:layout_width="30dp" android:layout_height="30dp" android:layout_centerVertical="true" android:layout_marginRight="14px" android:layout_toLeftOf="@id/pause_button" android:gravity="center" android:src="@drawable/pull_down_bar_black_out" /> <LinearLayout android:id="@+id/countdown_time_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/left_icon" android:orientation="vertical" > <TextView android:id="@+id/title_textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:ellipsize="middle" android:singleLine="true" android:text="@string/save_controll_title" android:textColor="#E5000000" android:textSize="16dp" /> <TextView android:id="@+id/summ_textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/share_button" android:layout_toRightOf="@+id/left_icon" android:ellipsize="middle" android:singleLine="true" android:text="@string/save_controll_text" android:textColor="#8A666666" android:textSize="14dp" /> </LinearLayout> </RelativeLayout>
3)finish_notification.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/status_bar_latest_event_content" android:layout_width="match_parent" android:layout_height="64dp" android:background="#fafafa" android:descendantFocusability="blocksDescendants" > <ImageView android:id="@+id/left_icon" android:layout_width="40dp" android:layout_height="40dp" android:layout_alignParentLeft="true" android:layout_centerInParent="true" android:layout_centerVertical="true" android:layout_marginLeft="12dp" android:layout_marginRight="12dp" android:src="@drawable/icon_pull_down_bar" /> <ImageView android:id="@+id/share_button" android:layout_width="30dp" android:layout_height="30dp" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="50px" android:gravity="center" android:src="@drawable/share" /> <LinearLayout android:id="@+id/notification_result_layout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/left_icon" android:orientation="vertical" > <TextView android:id="@+id/title_textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:ellipsize="middle" android:singleLine="true" android:text="@string/save_share_title" android:textColor="#E5000000" android:textSize="16dp" /> <TextView android:id="@+id/summ_textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/share_button" android:layout_toRightOf="@+id/left_icon" android:ellipsize="middle" android:singleLine="true" android:text="@string/save_share_text" android:textColor="#8A666666" android:textSize="14dp" /> </LinearLayout> </RelativeLayout>
4)float_window_big.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/big_window_layout" android:layout_width="184dp" android:layout_height="40dp" android:background="@drawable/spread" android:padding="0px" > <ImageView android:id="@+id/img_floatbig_status" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="14dp" android:padding="0px" android:src="@drawable/icon_screen_recorder_on" /> <TextView android:id="@+id/tx_floatbig_percent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="5dp" android:layout_toRightOf="@id/img_floatbig_status" android:padding="0px" android:textColor="#ffffff" /> <ImageButton android:id="@+id/imgbtn_floatbig_stoprecord" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="11dp" android:layout_toRightOf="@id/tx_floatbig_percent" android:padding="0px" android:src="@drawable/black_out"/> <ImageButton android:id="@+id/imgbtn_floatbig_pauserecord" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="9dp" android:layout_toRightOf="@id/imgbtn_floatbig_stoprecord" android:padding="0px" android:src="@drawable/suspend"/> <ImageButton android:id="@+id/imgbtn_floatbig_unfold" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_centerVertical="true" android:layout_marginLeft="9dp" android:layout_toRightOf="@id/imgbtn_floatbig_pauserecord" android:padding="0px" android:src="@drawable/withdraw" /> </RelativeLayout>
5)float_window_small.xml
<?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/small_window_layout_picture" android:layout_width="87dp" android:layout_height="21dp" android:background="@drawable/suspension_frame" android:padding="0px" > <ImageView android:id="@+id/img_floatsmall_status" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:padding="0px" android:src="@drawable/icon_screen_recorder_on" /> <TextView android:id="@+id/tx_floatsmall_percent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="7dp" android:layout_toRightOf="@id/img_floatsmall_status" android:padding="0px" android:textColor="#ffffff" /> <ImageView android:id="@+id/img_floatsmall_unfold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="7dp" android:layout_toRightOf="@id/tx_floatsmall_percent" android:padding="0px" android:src="@drawable/unfold_arrow" /> </RelativeLayout>
6)float_window_time.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/time_view" android:layout_width="100dp" android:layout_height="100dp" android:src="@drawable/icon_3" android:layout_centerInParent="true" /> </RelativeLayout>
7)gallery_item.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/dv_image" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout>
8)help_main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="@color/cardview_background_color" > <fragment android:name="com.zte.screenrecord.ui.HelpDetailFragment" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/showDetailFrg"></fragment> </LinearLayout>
9)setting_preference.xml
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <ListPreference android:defaultValue="0" android:dialogTitle="@string/typeview_popdialog" android:key="typeview" android:title="@string/typeview_popdialog"/> <SwitchPreference android:defaultValue="true" android:key="recordervoice" android:summary="@string/recordervoice_summary" android:title="@string/recordervoice_title"/> <SwitchPreference android:defaultValue="true" android:key="controlpointer" android:summary="@string/controlpointer_summary" android:title="@string/controlpointer_title"/> <ListPreference android:defaultValue="0" android:dialogTitle="@string/location_popdialog" android:key="location" android:summary="@string/internal_location" android:title="@string/location_popdialog"/> <Preference android:key="help" android:persistent="false" android:title="@string/help" > <intent android:targetClass="com.zte.screenrecord.activity.HelpActivity" android:targetPackage="com.zte.screenrecord" /> </Preference> </PreferenceScreen>
10)settings_main.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <FrameLayout android:id="@+id/fragment_container" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentTop="true" /> </RelativeLayout>
11)user_help_show_detail.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <com.zte.screenrecord.ui.SlideUpView android:id="@+id/slideupview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginBottom="@dimen/slideupview_marginBottom" android:minHeight="@dimen/slideupview_minHeight" android:scrollbars="none" > <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <RelativeLayout android:id="@+id/dynamic_tv" android:layout_width="match_parent" android:layout_height="wrap_content" > <com.zte.screenrecord.ui.UserHelpGallery android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height="@dimen/gallery_height" android:hapticFeedbackEnabled="false" android:spacing="1.0dip" /> </RelativeLayout> <!-- 2222 --> <com.zte.mifavor.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="@dimen/gallery_height" card_view:cardBackgroundColor="@color/cardview_background_color" card_view:cardCornerRadius="0dp" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <!-- 1111 --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:orientation="horizontal" > <TextView android:id="@+id/head" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/head_marginEnd" android:layout_marginStart="@dimen/banner_right" android:layout_weight="0.5" android:fontFamily="Bold" android:gravity="center_vertical|top" android:lineSpacingExtra="3dp" android:maxWidth="@dimen/head_maxWidth" android:minHeight="@dimen/head_minHeight" android:paddingBottom="@dimen/head_marginEnd" android:paddingTop="@dimen/banner_right" android:singleLine="false" android:textColor="#000000" android:textSize="18sp" android:textStyle="bold" /> </LinearLayout> <!-- 1111 --> <LinearLayout android:id="@+id/mytextcontent1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:scrollbars="vertical" > <com.zte.screenrecord.ui.MyTextView android:id="@+id/intro" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginEnd="@dimen/banner_right" android:layout_marginStart="@dimen/banner_right" android:lineSpacingExtra="3dp" android:minHeight="@dimen/intro_minHeight" android:scrollbars="vertical" android:singleLine="false" android:textColor="#000000" android:textSize="16sp" /> </LinearLayout> </LinearLayout> </com.zte.mifavor.widget.CardView> <!-- 2222 --> </RelativeLayout> </com.zte.screenrecord.ui.SlideUpView> <com.zte.screenrecord.ui.CountDotView android:id="@+id/count_indicator" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerInParent="true" android:layout_marginBottom="@dimen/banner_right" android:orientation="horizontal" > </com.zte.screenrecord.ui.CountDotView> </RelativeLayout>
values
1)arrays.xml
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" translate="false"> <array name="record_screen" translate="false"> <item>@string/help</item> <item>@array/record_screen_pic</item> <item>@array/record_screen_intro</item> <item>@array/record_screen_head</item> </array> <array name="record_screen_pic" translate="false"> <item>@drawable/help_1</item> <item>@drawable/help_2</item> <item>@drawable/help_3</item> </array> <array name="record_screen_intro" translate="false"> <item>@string/record_screen_intro_001</item> <item>@string/record_screen_intro_002</item> <item>@string/record_screen_intro_003</item> </array> <array name="record_screen_head" translate="false"> <item>@string/record_screen_head_001</item> <item>@string/record_screen_head_002</item> <item>@string/record_screen_head_003</item> </array> </resources>
2)colors.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="actionbar_color">#f4f4f4</color> <color name="actionbar_txt_color">#e5000000</color> <color name="actionbar_cb_color">#00F</color> <color name="cardview_background_color">#fafafa</color> </resources>
3)dimens.xml
<resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <!-- ActionBar contentInsetStart --> <dimen name="actionbar_contentInsetStart">16dp</dimen> <dimen name="actionbar_subsettings_contentInsetStart">72dp</dimen> <dimen name="relativeLatout1_height">170dp</dimen> <dimen name="banner_text_marginTop">23dp</dimen> <dimen name="banner_right">16dp</dimen> <dimen name="slideupview_marginBottom">31dp</dimen> <dimen name="slideupview_minHeight">533dp</dimen> <dimen name="gallery_height">315dp</dimen> <dimen name="head_minHeight">48dp</dimen> <dimen name="head_marginEnd">8dp</dimen> <dimen name="head_maxWidth">280dp</dimen> <dimen name="tv_try_paddingTop">21dp</dimen> <dimen name="intro_minHeight">115dp</dimen> </resources>
4)strings.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?> <resources> <string name="app_name">录屏</string> <string name="action_settings">Settings</string> <string name="view_type_title_text">画质</string> <string name="view_type_title_detail_text">画质</string> <string name="recorder_voice_title_text">录制声音</string> <string name="recorder_voice_detail_text">录制麦克风声音</string> <string name="control_pointer_title_text">显示操作点</string> <string name="control_pointer_detail_text">点击屏幕时显示白色圈点</string> <string name="location_title_text">存储位置</string> <string name="help_title_text">帮助</string> <string name="typeview_popdialog">画质</string> <string name="high_view">超清(1280*720)</string> <string name="low_view">标清(840*480)</string> <string name="recordervoice_title">录制声音</string> <string name="recordervoice_summary">录制麦克风声音</string> <string name="controlpointer_title">显示操作点</string> <string name="controlpointer_summary">点击屏幕时显示白色圈点</string> <string name="location_popdialog">存储位置</string> <string name="external_location">存储在SD卡</string> <string name="internal_location">存储在手机</string> <string name="help">帮助</string> <string name="save_controll_title">正在使用录屏功能</string> <string name="save_controll_text">正在录制视频</string> <string name="save_share_title">查看已保存录制视频</string> <string name="save_share_text">点击查看录屏文件</string> </resources>
5)styles.xml
<resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Light"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> </style> <style name="VideoBrower.Holo.ActionBar" parent="@style/Widget.ZTE.Light.ActionBar"> <item name="android:displayOptions">showHome</item> <item name="android:background">@color/actionbar_color</item> <item name="android:icon">@android:color/transparent</item> </style> <!-- Application theme. --> <style name="AppTheme" parent="Theme.ZTE.Light"> <item name="android:actionBarStyle">@style/VideoBrower.Holo.ActionBar</item> <item name="android:statusBarColor">@color/actionbar_color</item> <item name="android:actionModeBackground">@color/actionbar_color</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:navigationBarColor">@color/mfv_common_nav</item> </style> </resources>
androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.zte.screenrecord" android:sharedUserId="android.uid.system" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="24" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> <uses-permission android:name="android.permission.READ_OWNER_DATA"/> <uses-permission android:name="android.permission.WRITE_OWNER_DATA"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.READ_LOGS" /> <uses-permission android:name="android.permission.MANAGE_MEDIA_PROJECTION" /> <protected-broadcast android:name="com.zte.screenrecord.engine.ScreenrecordService.STATUS_START"/> <protected-broadcast android:name="com.zte.screenrecord.engine.ScreenrecordService.STATUS_STOP"/> <application android:allowBackup="true" android:icon="@drawable/icon_pull_down_bar" android:label="@string/app_name" android:theme="@style/AppTheme" android:name="com.zte.screenrecord.engine.ShotApplication" > <!-- <activity android:name="com.zte.screenrecord.activity.MainActivity" android:label="@string/app_name" android:launchMode="standard"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> --> <activity android:name="com.zte.screenrecord.activity.SettingActivity" android:launchMode="standard"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <action android:name="com.android.settings.action.MF.SETTINGS" /> </intent-filter> <meta-data android:name="com.android.settings.category" android:value="com.android.setting.category.features"/> </activity> <activity android:name="com.zte.screenrecord.activity.HelpActivity" android:screenOrientation="portrait" android:launchMode="standard">" </activity> <service android:enabled="true" android:name="com.zte.screenrecord.engine.ScreenrecordService"></service> <receiver android:name="com.zte.screenrecord.engine.ScreenRecordReceiver"> <intent-filter> <action android:name="com.zte.screenrecord.engine.ScreenrecordService.ACTION_START_RECORD" /> <action android:name="com.zte.screenrecord.engine.ScreenrecordService.ACTION_STOP_RECORD" /> <action android:name="com.zte.screenrecord.engine.ScreenrecordService.ACTION_PAUSE_RECORD" /> <action android:name="com.zte.screenrecord.engine.ScreenrecordService.ACTION_RESUME_RECORD" /> <action android:name="com.zte.screenrecord.engine.ScreenrecordService.ACTION_ERROR_RECORD" /> </intent-filter> </receiver> </application> </manifest>