Skip to content

Commit

Permalink
added CreateTorrentActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Oct 26, 2016
1 parent b613291 commit de5bae0
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/TriblerApp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
android:name="android.support.PARENT_ACTIVITY"
android:value="org.tribler.android.ChannelActivity" />
</activity>
<activity
android:name=".CreateTorrentActivity"
android:label="@string/action_create_torrent"
android:theme="@style/AppTheme.NoActionBar" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.tribler.android;

import android.content.Intent;
import android.os.Bundle;

public class CreateTorrentActivity extends BaseActivity {

/**
* {@inheritDoc}
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_torrent);
}

/**
* {@inheritDoc}
*/
@Override
protected void handleIntent(Intent intent) {
//TODO
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="https://schemas.android.com/apk/res/android"
xmlns:app="https://schemas.android.com/apk/res-auto"
xmlns:tools="https://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".CreateTorrentActivity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/activity_create_torrent_form" />

</android.support.design.widget.CoordinatorLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="https://schemas.android.com/apk/res/android"
xmlns:app="https://schemas.android.com/apk/res-auto"
xmlns:fancy="https://schemas.android.com/apk/res-auto"
xmlns:tools="https://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".CreateTorrentActivity"
tools:showIn="@layout/activity_create_torrent">

<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="5">

<TextView
android:id="@+id/torrent_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_row="0"
android:padding="@dimen/label_padding"
android:text="@string/explain_create_torrent" />

<RelativeLayout
android:id="@+id/torrent_thumbnail_wrapper"
android:layout_width="320dp"
android:layout_height="240dp"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_gravity="center"
android:layout_margin="25dp"
android:layout_row="1">

<ImageView
android:id="@+id/torrent_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<FrameLayout
android:id="@+id/torrent_thumbnail_progress_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ProgressBar
android:id="@+id/torrent_progress_bar"
style="?android:attr/progressBarStyle"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_gravity="center"
android:indeterminate="true" />

</FrameLayout>

</RelativeLayout>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="2"
android:padding="@dimen/label_padding"
android:text="@string/label_torrent_name"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />

<EditText
android:id="@+id/torrent_name_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="fill_horizontal"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_row="2"
android:inputType="text" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="3"
android:padding="@dimen/label_padding"
android:text="@string/label_torrent_description"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />

<EditText
android:id="@+id/torrent_description_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="fill_horizontal"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_row="3"
android:inputType="textMultiLine" />

<mehdi.sakout.fancybuttons.FancyButton
android:id="@+id/btn_torrent_create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/fancy_button_vertical_margin"
android:layout_marginTop="@dimen/fancy_button_vertical_margin"
android:layout_row="4"
android:onClick="btnChannelSaveClicked"
android:paddingBottom="@dimen/fancy_button_vertical_padding"
android:paddingEnd="@dimen/fancy_button_horizontal_padding"
android:paddingStart="@dimen/fancy_button_horizontal_padding"
android:paddingTop="@dimen/fancy_button_vertical_padding"
fancy:fb_borderColor="@color/red"
fancy:fb_borderWidth="2dp"
fancy:fb_defaultColor="@color/transparent"
fancy:fb_radius="30dp"
fancy:fb_text="@string/action_CREATE"
fancy:fb_textColor="@color/red" />

</GridLayout>

</ScrollView>

0 comments on commit de5bae0

Please sign in to comment.