Show URL in feed info, layout optimizations

This commit is contained in:
Martin Fietz 2015-04-21 17:34:02 +02:00
parent 8c148b738e
commit 7829ddc94e
4 changed files with 104 additions and 73 deletions

View File

@ -6,6 +6,7 @@ repositories {
dependencies { dependencies {
compile 'com.android.support:support-v4:21.0.3' compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:gridlayout-v7:21.0.3'
compile 'org.apache.commons:commons-lang3:3.3.2' compile 'org.apache.commons:commons-lang3:3.3.2'
compile('org.shredzone.flattr4j:flattr4j-core:2.12') { compile('org.shredzone.flattr4j:flattr4j-core:2.12') {
exclude group: 'org.json', module: 'json' exclude group: 'org.json', module: 'json'

View File

@ -17,7 +17,6 @@ import android.widget.TextView;
import com.squareup.picasso.Picasso; import com.squareup.picasso.Picasso;
import de.danoeh.antennapod.BuildConfig;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.Feed;
@ -44,6 +43,7 @@ public class FeedInfoActivity extends ActionBarActivity {
private TextView txtvDescription; private TextView txtvDescription;
private TextView txtvLanguage; private TextView txtvLanguage;
private TextView txtvAuthor; private TextView txtvAuthor;
private TextView txtvUrl;
private EditText etxtUsername; private EditText etxtUsername;
private EditText etxtPassword; private EditText etxtPassword;
private CheckBox cbxAutoDownload; private CheckBox cbxAutoDownload;
@ -61,6 +61,7 @@ public class FeedInfoActivity extends ActionBarActivity {
txtvDescription = (TextView) findViewById(R.id.txtvDescription); txtvDescription = (TextView) findViewById(R.id.txtvDescription);
txtvLanguage = (TextView) findViewById(R.id.txtvLanguage); txtvLanguage = (TextView) findViewById(R.id.txtvLanguage);
txtvAuthor = (TextView) findViewById(R.id.txtvAuthor); txtvAuthor = (TextView) findViewById(R.id.txtvAuthor);
txtvUrl = (TextView) findViewById(R.id.txtvUrl);
cbxAutoDownload = (CheckBox) findViewById(R.id.cbxAutoDownload); cbxAutoDownload = (CheckBox) findViewById(R.id.cbxAutoDownload);
etxtUsername = (EditText) findViewById(R.id.etxtUsername); etxtUsername = (EditText) findViewById(R.id.etxtUsername);
etxtPassword = (EditText) findViewById(R.id.etxtPassword); etxtPassword = (EditText) findViewById(R.id.etxtPassword);
@ -76,10 +77,9 @@ public class FeedInfoActivity extends ActionBarActivity {
protected void onPostExecute(Feed result) { protected void onPostExecute(Feed result) {
if (result != null) { if (result != null) {
feed = result; feed = result;
if (BuildConfig.DEBUG)
Log.d(TAG, "Language is " + feed.getLanguage()); Log.d(TAG, "Language is " + feed.getLanguage());
if (BuildConfig.DEBUG)
Log.d(TAG, "Author is " + feed.getAuthor()); Log.d(TAG, "Author is " + feed.getAuthor());
Log.d(TAG, "URL is " + feed.getDownload_url());
imgvCover.post(new Runnable() { imgvCover.post(new Runnable() {
@Override @Override
@ -92,7 +92,7 @@ public class FeedInfoActivity extends ActionBarActivity {
}); });
txtvTitle.setText(feed.getTitle()); txtvTitle.setText(feed.getTitle());
txtvDescription.setText(feed.getDescription()); txtvDescription.setText(feed.getDescription().trim());
if (feed.getAuthor() != null) { if (feed.getAuthor() != null) {
txtvAuthor.setText(feed.getAuthor()); txtvAuthor.setText(feed.getAuthor());
} }
@ -100,6 +100,7 @@ public class FeedInfoActivity extends ActionBarActivity {
txtvLanguage.setText(LangUtils txtvLanguage.setText(LangUtils
.getLanguageString(feed.getLanguage())); .getLanguageString(feed.getLanguage()));
} }
txtvUrl.setText(feed.getDownload_url());
cbxAutoDownload.setEnabled(UserPreferences.isEnableAutodownload()); cbxAutoDownload.setEnabled(UserPreferences.isEnableAutodownload());
cbxAutoDownload.setChecked(feed.getPreferences().getAutoDownload()); cbxAutoDownload.setChecked(feed.getPreferences().getAutoDownload());

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -11,7 +12,10 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"> android:gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp">
<ImageView <ImageView
android:id="@+id/imgvCover" android:id="@+id/imgvCover"
@ -20,26 +24,26 @@
android:layout_height="70dp" android:layout_height="70dp"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_margin="4dp"
tools:src="@drawable/ic_stat_antenna_default" tools:src="@drawable/ic_stat_antenna_default"
tools:background="@android:color/holo_green_dark" /> tools:background="@android:color/holo_green_dark"/>
<TextView <TextView
android:id="@+id/txtvTitle" android:id="@+id/txtvTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_margin="4dp" android:layout_marginLeft="8dp"
android:layout_toRightOf="@id/imgvCover" android:layout_toRightOf="@id/imgvCover"
style="@style/AntennaPod.TextView.Heading" style="@style/AntennaPod.TextView.Heading"
tools:text="Feed title" tools:text="Feed title"
tools:background="@android:color/holo_green_dark" /> tools:background="@android:color/holo_green_dark"/>
<View <View
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_below="@id/imgvCover" android:layout_below="@id/imgvCover"
android:layout_marginTop="8dp"
android:background="@color/bright_blue"/> android:background="@color/bright_blue"/>
</RelativeLayout> </RelativeLayout>
@ -47,99 +51,120 @@
android:id="@+id/scrollView" android:id="@+id/scrollView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"> android:layout_weight="1"
android:scrollbarStyle="outsideInset"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingBottom="8dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <android.support.v7.widget.GridLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"> android:layout_marginTop="8dp"
app:columnCount="2"
<View app:rowCount="3">
android:id="@+id/center_divider"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_centerHorizontal="true"/>
<TextView <TextView
android:id="@+id/lblAuthor" android:id="@+id/lblAuthor"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_margin="8dp" android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_row="0"
app:layout_column="0"
android:lines="1"
android:text="@string/author_label" android:text="@string/author_label"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
tools:background="@android:color/holo_red_light" /> tools:background="@android:color/holo_red_light"/>
<TextView <TextView
android:id="@+id/txtvAuthor" android:id="@+id/txtvAuthor"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" app:layout_row="0"
android:layout_margin="8dp" app:layout_column="1"
android:layout_toRightOf="@id/center_divider"
tools:text="Daniel Oeh" tools:text="Daniel Oeh"
tools:background="@android:color/holo_green_dark" /> tools:background="@android:color/holo_green_dark"/>
<TextView <TextView
android:id="@+id/lblLanguage" android:id="@+id/lblLanguage"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_marginRight="8dp"
android:layout_below="@id/txtvAuthor" android:layout_marginBottom="8dp"
android:layout_margin="8dp" app:layout_row="1"
app:layout_column="0"
android:lines="1"
android:text="@string/language_label" android:text="@string/language_label"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
tools:background="@android:color/holo_red_light" /> tools:background="@android:color/holo_red_light"/>
<TextView <TextView
android:id="@+id/txtvLanguage" android:id="@+id/txtvLanguage"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" app:layout_row="1"
android:layout_below="@id/txtvAuthor" app:layout_column="1"
android:layout_margin="8dp"
android:layout_toRightOf="@id/center_divider"
tools:text="English" tools:text="English"
tools:background="@android:color/holo_green_dark" /> tools:background="@android:color/holo_green_dark"/>
</RelativeLayout>
<TextView
android:id="@+id/lblUrl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_row="2"
app:layout_column="0"
android:lines="1"
android:text="@string/url_label"
android:textColor="?android:attr/textColorPrimary"
tools:background="@android:color/holo_red_light"/>
<TextView
android:id="@+id/txtvUrl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_row="2"
app:layout_column="1"
tools:text="http://www.example.com/feed"
tools:background="@android:color/holo_green_dark"/>
</android.support.v7.widget.GridLayout>
<TextView <TextView
android:id="@+id/txtvSettings" android:id="@+id/txtvSettings"
style="@style/AntennaPod.TextView.Heading" style="@style/AntennaPod.TextView.Heading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp"
android:text="@string/podcast_settings_label" android:text="@string/podcast_settings_label"
android:layout_marginLeft="8dp" android:layout_marginTop="8dp"/>
android:layout_marginBottom="8dp"
android:layout_marginTop="24dp"/>
<CheckBox <CheckBox
android:id="@+id/cbxAutoDownload" android:id="@+id/cbxAutoDownload"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_marginTop="8dp"
android:text="@string/auto_download_label" android:text="@string/auto_download_label"
android:enabled="false" android:enabled="false"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
tools:background="@android:color/holo_red_light" /> tools:background="@android:color/holo_red_light"
android:checked="false"/>
<TextView <TextView
android:id="@+id/txtvAuthentication" android:id="@+id/txtvAuthentication"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_marginTop="8dp"
android:text="@string/authentication_label" android:text="@string/authentication_label"
android:textSize="@dimen/text_size_medium" android:textSize="@dimen/text_size_medium"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"/>
android:layout_marginLeft="8dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="24dp"/>
<TextView <TextView
android:id="@+id/txtvAuthenticationDescr" android:id="@+id/txtvAuthenticationDescr"
@ -148,71 +173,74 @@
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp"/> android:layout_marginTop="8dp"/>
<LinearLayout <android.support.v7.widget.GridLayout
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp"> android:layout_marginTop="8dp"
app:columnCount="2"
app:rowCount="3"
android:layout_gravity="center_horizontal">
<TextView <TextView
android:id="@+id/txtvUsername" android:id="@+id/txtvUsername"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_row="0"
app:layout_column="0"
android:text="@string/username_label" android:text="@string/username_label"
android:textColor="?android:attr/textColorPrimary"/> android:textColor="?android:attr/textColorPrimary"/>
<EditText <EditText
android:id="@+id/etxtUsername" android:id="@+id/etxtUsername"
android:layout_width="0dp" android:layout_width="140sp"
android:layout_weight="2"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_row="0"
app:layout_column="1"
android:hint="@string/username_label"/> android:hint="@string/username_label"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp">
<TextView <TextView
android:id="@+id/txtvPassword" android:id="@+id/txtvPassword"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_row="1"
app:layout_column="0"
android:text="@string/password_label" android:text="@string/password_label"
android:textColor="?android:attr/textColorPrimary"/> android:textColor="?android:attr/textColorPrimary"/>
<EditText <EditText
android:id="@+id/etxtPassword" android:id="@+id/etxtPassword"
android:layout_width="0dp" android:layout_width="140sp"
android:layout_weight="2"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_row="1"
app:layout_column="1"
android:hint="@string/password_label" android:hint="@string/password_label"
android:inputType="textPassword"/> android:inputType="textPassword"/>
</LinearLayout>
</android.support.v7.widget.GridLayout>
<TextView <TextView
style="@style/AntennaPod.TextView.Heading" style="@style/AntennaPod.TextView.Heading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="24dp"
android:text="@string/description_label"/> android:text="@string/description_label"/>
<TextView <TextView
android:id="@+id/txtvDescription" android:id="@+id/txtvDescription"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_marginTop="8dp"
android:text="@string/design_time_lorem_ipsum" android:text="@string/design_time_lorem_ipsum"
tools:background="@android:color/holo_green_dark" /> tools:background="@android:color/holo_green_dark"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>

View File

@ -48,6 +48,7 @@
<string name="cancel_label">Cancel</string> <string name="cancel_label">Cancel</string>
<string name="author_label">Author</string> <string name="author_label">Author</string>
<string name="language_label">Language</string> <string name="language_label">Language</string>
<string name="url_label">URL</string>
<string name="podcast_settings_label">Settings</string> <string name="podcast_settings_label">Settings</string>
<string name="cover_label">Picture</string> <string name="cover_label">Picture</string>
<string name="error_label">Error</string> <string name="error_label">Error</string>