created error report activity

This commit is contained in:
Christian Schabesberger 2016-02-24 23:12:02 +01:00
parent 11d3aeb0dd
commit 27a2dee3bd
8 changed files with 146 additions and 20 deletions

View File

@ -1,23 +1,25 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="org.schabi.newpipe" > package="org.schabi.newpipe">
<uses-permission android:name= "android.permission.INTERNET" />
<uses-permission android:name= "android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application <application
android:name=".App" android:name=".App"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:logo="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:logo="@mipmap/ic_launcher"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
tools:ignore="AllowBackup"> tools:ignore="AllowBackup">
<activity <activity
android:name=".VideoItemListActivity" android:name=".VideoItemListActivity"
android:label="@string/app_name" android:configChanges="orientation|screenSize"
android:configChanges="orientation|screenSize"> android:label="@string/app_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -26,10 +28,10 @@
</activity> </activity>
<activity <activity
android:name=".VideoItemDetailActivity" android:name=".VideoItemDetailActivity"
android:label="@string/title_videoitem_detail"
android:theme="@style/AppTheme"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:screenOrientation="portrait"> android:label="@string/title_videoitem_detail"
android:screenOrientation="portrait"
android:theme="@style/AppTheme">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value=".VideoItemListActivity" /> android:value=".VideoItemListActivity" />
@ -76,20 +78,21 @@
<data android:scheme="vnd.youtube.launch" /> <data android:scheme="vnd.youtube.launch" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".PlayVideoActivity" <activity
android:name=".PlayVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize" android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/VideoPlayerTheme"
android:parentActivityName=".VideoItemDetailActivity" android:parentActivityName=".VideoItemDetailActivity"
tools:ignore="UnusedAttribute"> android:theme="@style/VideoPlayerTheme"
</activity> tools:ignore="UnusedAttribute"></activity>
<service <service
android:name=".BackgroundPlayer" android:name=".BackgroundPlayer"
android:label="@string/background_player_name" android:exported="false"
android:exported="false" /> android:label="@string/background_player_name" />
<activity <activity
android:name=".SettingsActivity" android:name=".SettingsActivity"
android:label="@string/settings_activity_title" > android:label="@string/settings_activity_title"></activity>
</activity>
<activity <activity
android:name=".PanicResponderActivity" android:name=".PanicResponderActivity"
android:launchMode="singleInstance" android:launchMode="singleInstance"
@ -97,11 +100,14 @@
android:theme="@android:style/Theme.NoDisplay"> android:theme="@android:style/Theme.NoDisplay">
<intent-filter> <intent-filter>
<action android:name="info.guardianproject.panic.action.TRIGGER" /> <action android:name="info.guardianproject.panic.action.TRIGGER" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ExitActivity" android:name=".ExitActivity"
android:theme="@android:style/Theme.NoDisplay" /> android:theme="@android:style/Theme.NoDisplay" />
<activity android:name=".errorhandling.ErrorActivity"></activity>
</application> </application>
</manifest> </manifest>

View File

@ -17,6 +17,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.Toast; import android.widget.Toast;
import org.schabi.newpipe.errorhandling.ErrorActivity;
import org.schabi.newpipe.extractor.ExtractionException; import org.schabi.newpipe.extractor.ExtractionException;
import org.schabi.newpipe.extractor.SearchEngine; import org.schabi.newpipe.extractor.SearchEngine;
import org.schabi.newpipe.extractor.ServiceList; import org.schabi.newpipe.extractor.ServiceList;
@ -240,6 +241,12 @@ public class VideoItemListActivity extends AppCompatActivity
} }
PreferenceManager.setDefaultValues(this, R.xml.settings, false); PreferenceManager.setDefaultValues(this, R.xml.settings, false);
/* this is for debuging only if this is still pressent in master branch kill the programmer */
startActivity(new Intent(this, ErrorActivity.class));
//-------------------------------------------------------------------------
} }
@Override @Override

View File

@ -17,7 +17,6 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import org.schabi.newpipe.extractor.ExtractionException; import org.schabi.newpipe.extractor.ExtractionException;
import org.schabi.newpipe.extractor.ParsingException;
import org.schabi.newpipe.extractor.VideoPreviewInfo; import org.schabi.newpipe.extractor.VideoPreviewInfo;
import org.schabi.newpipe.extractor.SearchEngine; import org.schabi.newpipe.extractor.SearchEngine;
import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.StreamingService;

View File

@ -0,0 +1,15 @@
package org.schabi.newpipe.errorhandling;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import org.schabi.newpipe.R;
public class ErrorActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_error);
}
}

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
tools:context="org.schabi.newpipe.errorhandling.ErrorActivity">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<TextView
android:id="@+id/errorSorryView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/sorry_string"
android:textStyle="bold" />
<TextView
android:id="@+id/errorWhatHappenedView"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="What happened:"/>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/horizontalScrollView"
android:layout_gravity="center" >
<TextView
android:id="@+id/errorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:typeface="monospace"
android:text="asdkfjasdhfjshgfgnigregirenigneigheuigeorigjweogijhegiohegojiegoergjeogheoghweoghiehgohewgoiwehogihewrghieogh
&#xA;asdfgeogirejgoeirjgoregjogijegoiwejg
&#xA;wergjergljegoiejgoeigjogjeogjegohgeoigheognmgnbnorneog
&#xA;ergoegremgekgnonhotnhotrnhkhnh
&#xA;safs
&#xA;f
&#xA;s
&#xA;f
&#xA;f
&#xA;f
&#xA;safasf
&#xA;sageoigohntrh
&#xA;trhoijrhoirnhohintrionbobirnionb
&#xA;boitrnobinobnroni
&#xA;sadfsfagfkjgnsfdljhenvgoenvjibnoenpeoignweguihregpiorhnpoithtvhiohöio höio ho fvgegh gsfdsfd
&#xA;sfdaiohsfdiousfdahoiuhsfdaoiusfd oifdhoifdho fvigh fvuigupi refsfdasklsdfhsalkjfhsalkfjsa
&#xA;salgkjsfdgkjreog ehpio vpo hfgoeiwrhpwreo ibbuhwfgeubuh l jhjkb
&#xA;ssfda
&#xA;sfda
&#xA;sfda
&#xA;sfda
&#xA;
&#xA;sagrejgorigjeoigjgkofdjgölkfdjgsdökgjklgjoe
&#xA;sfdafgs
&#xA;dfg
&#xA;sd
&#xA;fg"/>
</HorizontalScrollView>
<Button
android:id="@+id/errorReportButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/error_report_button_text" />
</LinearLayout>
</ScrollView>
</FrameLayout>

View File

@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>

View File

@ -35,5 +35,8 @@
<!-- Paddings & Margins --> <!-- Paddings & Margins -->
<dimen name="video_item_detail_like_margin">6sp</dimen> <dimen name="video_item_detail_like_margin">6sp</dimen>
<dimen name="video_item_detail_play_fab_margin">20dp</dimen> <dimen name="video_item_detail_play_fab_margin">20dp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources> </resources>

View File

@ -88,6 +88,9 @@
<string name="blocked_by_gema">Blocked by GEMA.</string> <string name="blocked_by_gema">Blocked by GEMA.</string>
<string name="could_not_setup_download_menu">Could not setup download menu.</string> <string name="could_not_setup_download_menu">Could not setup download menu.</string>
<string name="live_streams_not_supported">This is a LIVE STREAM. These are not yet supported.</string> <string name="live_streams_not_supported">This is a LIVE STREAM. These are not yet supported.</string>
<!-- error activity -->
<string name="sorry_string">Sorry that shouldn#t have happened.</string>
<string name="error_report_button_text">Report error via mail</string>
<!-- Content descriptions (for better accessibility) --> <!-- Content descriptions (for better accessibility) -->