-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tribler Android App #2476
Closed
Closed
Tribler Android App #2476
Changes from 1 commit
Commits
Show all changes
644 commits
Select commit
Hold shift + click to select a range
a06094b
annotations and doc
brussee f6e1660
improve function name
brussee d796b94
navigation backstack
brussee 5824fb4
json classes implements Serializable
brussee ee24bf8
retain fragments for rotation handling
brussee c65378a
minor
brussee e350940
debounce search
brussee 37c61df
remove dummy settings activity
brussee 1f1b123
refactor network connection broadcast receiver
brussee f4b9122
refactor fragment inheritence
brussee 2db5b23
null check
brussee a483d36
check if new query equals current
brussee 2ffa129
memory leaks fixed enable stetho
brussee a8765b5
use RxBroadcast
brussee 06c1a19
bugfix okhttp client
brussee 164e298
proper getters
brussee 0b275ad
warn user if network connection is lost
brussee b141e73
handleIntent
brussee 6693035
getApplicationContext().getSystemService
brussee 12d8a87
fix focus lost issue while typing search query
brussee 6edc328
do not reload and retain fragments
brussee e472114
disable stetho due to crashes:
brussee f5b6e73
fix channel back button if searchview is expanded
brussee 2ef5b3f
service init sequence
brussee 3d1a31f
remove connection pool setting
brussee e3c605d
service binder interface
brussee 71cde36
bind service interface
brussee 9ec8bc8
bugfix search and added exception logging
brussee 0b2cbd4
verbose lifecycle logging
brussee 6358a71
get data set shallow clone
brussee f2a38de
bugfix nullpointer
brussee 326c0aa
split handle on new intent
brussee 94b567b
ShutdownAck
brussee 712ba91
refactor event stream
brussee e2a488f
loading bar
brussee 3a4f4df
bugfix
brussee 04905f8
thread safety
brussee 8d808fb
plug memory leak
brussee 9e56564
kleurtjes
brussee 0db4710
bugfix event empty line and channel list layout
brussee 12f8ff5
plug memory leak
brussee 241a50c
loading screen
brussee b418d1b
bugfix
brussee ea4cb1d
eventstream ready flag and backwards compatible layout
brussee 1337042
loading state management
brussee 1f4bd00
use message handlers with main thread looper and close event stream
brussee 9ab138e
bugfix loading indicator
brussee b70c1f7
ready check
brussee b75b0b7
bugfix
brussee b406dfe
kill process on shutdown
brussee 04f76b0
minor
brussee edb20a9
torrent list layout
brussee 2caac67
si units
brussee 327df48
my channel and popular channels
brussee 2cabd5f
auto retry
brussee d883fcf
nullcheck
brussee 0e74708
auto retry
brussee bdc1916
my channel layout
brussee 5f13f7b
remove toolbar back button and auto refresh toolbar
brussee 940193f
startup action
brussee deeadd9
bugfix toolbar
brussee a2af7da
bugfix toolbar 2
brussee d90b58a
bugfix toolbar 3
brussee 435965c
clean build every time due to layout bug
brussee 17b1773
retry max 3 times
brussee cc93371
equals method now only uses infohash or dispersy_cid
brussee cc98545
bugfix nullpointer
brussee 637460f
refresh view on return
brussee f638b18
disable clean build
brussee d15129c
fix crash on rotate and bugfix retry
brussee ae4ce89
fix progressbar layout issue
brussee 6f12d68
reload view after search
brussee df83be1
upgrade experimental gradle version
brussee 402e11e
bugfix fast scroller
brussee bfea736
more efficient parsing
brussee d6b6123
lower python log level to warning
brussee 8665f7d
increase timeout
brussee 240bc14
documentation in build.gradle
brussee 034d2bf
ask user with dialog
brussee 38522df
shutdown confirm dialog
brussee 33c58c2
fix back button
brussee 9dfe482
create my channel
brussee 0282335
retry timeout of 1s
brussee 8b848b4
refactor base fragment
brussee 390493d
create channel fragment
brussee 7c82738
my channel overview
brussee 6f5bff2
edit my channel
brussee 611be37
status message
brussee 85c4c21
update title after edit my channel
brussee 4c038aa
keep state of fragment my channel
brussee 0ef3bb4
plug memory leak options menu rx subscriptions
brussee cae088e
bugfix edit channel layout
brussee 6120dd4
doc and open drawer only once
brussee 68a5cdc
update RxJava to 1.1.9
brussee e3185bb
clear statusBar
brussee 1b99963
browse and copy file utils
brussee f1da4c5
add torrent to channel
brussee 14945b2
ask user to confirm remove torrent from my channel
brussee f31d761
minor
brussee e200a0e
torrent discovered listener
brussee caef9c5
subscribe with beam
brussee 74ac9ba
minor
brussee 1d76013
ask permission on runtime
brussee 06e1e40
minor
brussee 8e8aec8
change rest api port to 8085
brussee 51f4637
update gradle experimental alpha to beta
brussee 488aa63
minor update build tools
brussee ce5edee
python services with adb amstart from command line
brussee 678cc41
add vlc
brussee af21412
update gradle experimental 0.8.0 beta 3 to release candidate 1
brussee 42416c2
add android support test runner and test manifest.xml to override ann…
brussee b816879
add wifi p2p
brussee 2dea6fe
update gradle experimental 0.8.0 release candidate 1 to 2
brussee 6f66e9d
update gradle experimental 0.8.0 release candidate 2 to final release
brussee 4086903
update android support libraries 24.2.0 to 24.2.1
brussee b084917
update stetho and leakcanary
brussee f935810
minor
brussee 1e0aaa4
fix layout drawer header padding
brussee 324f331
MainActivity stop listening to events
brussee 7ee4328
bugfix thread.sleep on main thread
brussee 0409d6d
workaround bug https://code.google.com/p/android/issues/detail?id=211164
brussee f957047
auto retry 3 times with incremental delay
brussee eb899be
catch specific api http exceptions
brussee fcdb893
Avoid FileUriExposedException
brussee 0f883e3
update gradle experimental to 0.8.1
brussee febe4a1
doOnError MyUtils.onError
brussee 2da54a4
update build tools to 24.0.3
brussee 28f52c8
reload() using cancel()
brussee 967cab0
less verbose logging on connect service event stream
brussee 21e53cf
use @StringResId
brussee 2f6ec52
workaround snackbar action listener memory leak
brussee 9ab5352
auto retry with cancel option
brussee c09fce2
refactor reload
brussee 314adff
move resolveUri to utils
brussee 820d4ec
simplify MyUtils.onError
brussee 9c957a4
verbose logging oneSecondDelay
brussee 06d8a17
two seconds delay
brussee 465e9a4
doc
brussee 46c7a92
bugfix: setTitle after orientation change (on rotate)
brussee f51ab8a
simplify showLoading
brussee b6e9cfb
remove cancel()
brussee 0f8a902
bugfix: edit channel input
brussee 5e2661a
bugfix: memory leak menu searchView
brussee 0b7233d
bugfix: memory leak textView
brussee 8d63abc
bugfix: handle edit channel intent
brussee b14b654
getCurrentFragment()
brussee 0a77796
remove unreachable code
brussee 08f1772
remove edit channel activity fragment
brussee 9310eab
remove onComplete this.finish()
brussee 391f3a2
add subscribe to channel request code
brussee 2c4c810
save state in ChannelFragment
brussee 427e0eb
update gradle experimental to 0.8.2
brussee 99391d5
update build tools to 25.0.0
brussee 656737e
update rxjava to 1.2.1
brussee 6f72c7c
bugfix: torrent category nullpointer
brussee 27f2341
bundle original vlc apk with app
brussee 9c607d8
bugfix: show loading nullpointer
brussee d733f35
Dynamic linker works properly since api level 18
brussee 6e83c42
make boost recipe compatible with Google NDK 13.0
brussee b988da6
add event body to event stream start event
brussee e94a845
add torrent discovered event information
brussee 2742c05
add discovered torrent to channel list immediately
brussee c78ab50
sum of file sizes for discovered torrent
brussee b22faf3
torrent activity & fragment
brussee 120f287
minor
brussee 1bc954d
implemented downloads api
brussee d469199
implemented torrent removed from channel event
brussee bbcdbf5
various null checks
brussee e6917d7
fix services
brussee 4c8b95d
added CreateTorrentActivity
brussee baef2ee
no need to listen to event stream if already started
brussee 51ca5a6
disable family filter for fetching torrents in channels
brussee 0e784dc
copy files activity & adb pull script
brussee 8c57976
working copy files script
brussee e7dc988
working adb push script
brussee 1191f61
robust logcat parsing
brussee 2ecb970
automated experiment running
brussee 6415c69
ask write permissions for external storage
brussee 5e05f1c
move scripts & uniform setup
brussee 31d8a3d
write .Tribler appstate dir to external storage on Android
brussee 808d665
version code
brussee 797b779
bugfix script adb_pull.py
brussee 9d215f9
re_install script restores default appstate
brussee 5db7087
pylint fix: don't re-define file
brussee 66882a4
version code
brussee 6ba2b90
pylint fix: remove semicolon
brussee 7aa97c8
double .Tribler subdir
brussee eb250bf
bugfix: .
brussee 1e2167a
run experiment local script
brussee 3047206
graph data 0 0
brussee 5332a77
bugfix: .
brussee 481fb92
more robust parsing logcat
brussee 227bebc
show error if input file does not exist
brussee c835b3c
bugfix: mkdirs
brussee ce55509
logcat clear on start only
brussee 52ed825
get public dir
brussee a4bd106
hardcode sdcard
brussee 7076a80
ask write permissions
brussee 814cabf
clean app state
brussee 100e5dc
nosetests output path
brussee bc600ca
Jenkins workspace environment variable for local Tribler source root
brussee e1a041a
Jenkins environment variable for VLC .apk
brussee 393abf7
run gradlew of build & deploy script from app root
brussee 25f909f
add local.properties (for Jenkins)
brussee bfa1572
separate scripts
brussee 386ce31
add shutdown script
brussee 6bab543
nosetests output in files dir
brussee a6f2d58
separate scripts
brussee f5d24e6
startup and shutdown timer
brussee 1771287
verbose logging
brussee d269b6c
reduce sleep time
brussee 4fbe88c
write logcat to file while waiting for process to die
brussee bd9506d
add verbose logging
brussee fdf2ad1
nfc beam any channel
brussee 7a50274
fix post array field
brussee f2b166c
improved error handling add torrent
brussee 0227fe6
onRecording finished ask user to publish immediately
brussee 3289b95
add update script
brussee de3e08d
always verbose logging
brussee 35e67cf
copy to external cache dir
brussee 25b1110
update sqlite to 3.15.1 with FTS4
brussee f57346e
update apsw to 3.15.0-r1 with FTS4
brussee ef53119
update P4A by switching to upstream master
brussee 3ede3ea
https download sqlite3
brussee 7bdd54a
no longer necessary since min api level was increased to 18
brussee 9a8f010
update jars
brussee 094c6f8
force p4a reinstall
brussee d7aa2ad
turn off wake lock and wifi lock
brussee ce60b95
remove shutdown gracetime (#2635)
brussee 6513ed8
implement start download rest api
brussee 1bdac94
rename start download ack
brussee 019e1d7
start seeding after adding torrent to channel
brussee 81d68d7
fix api interface
brussee 32f33b2
implement get settings endpoint
brussee ba95a47
add videoserver client
brussee dee64cf
remove videoserver client
brussee cc053a5
fix memory leak async start download
brussee 64a0069
play video
brussee c0f14b8
set download dir
brussee e2b8a0d
bugfix form encoding
brussee 23ec195
more verbose logging
brussee 28f0042
parse string port value
brussee 1c9e05e
add new videos to gallery
brussee 05e2066
save new torrent file next to content
brussee 51a4d1f
working! seeding from phone
brussee 6a4e1b8
parse video port value
brussee 2ddebf0
working! playback intent
brussee 52f383f
remove workaround
brussee b5db95f
do not force play from start
brussee d1a1d0b
use public download dir
brussee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
create my channel
- Loading branch information
commit 9dfe4824793316969dd4c23fe0d3a4fc439350b2
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
android/TriblerApp/app/src/main/java/org/tribler/android/EditChannelActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
package org.tribler.android; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.text.TextUtils; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import org.tribler.android.restapi.IRestApi; | ||
import org.tribler.android.restapi.TriblerService; | ||
import org.tribler.android.restapi.json.AddedChannelAck; | ||
import org.tribler.android.restapi.json.ModifiedAck; | ||
|
||
import butterknife.BindView; | ||
import rx.Observer; | ||
import rx.android.schedulers.AndroidSchedulers; | ||
import rx.schedulers.Schedulers; | ||
|
||
public class EditChannelActivity extends BaseActivity { | ||
|
||
public static final String ACTION_CREATE_CHANNEL = "org.tribler.android.channel.CREATE"; | ||
|
||
private IRestApi _service; | ||
|
||
@BindView(R.id.channel_icon_wrapper) | ||
View iconWrapper; | ||
|
||
@BindView(R.id.channel_icon) | ||
ImageView icon; | ||
|
||
@BindView(R.id.channel_capital) | ||
TextView nameCapital; | ||
|
||
@BindView(R.id.my_channel_explanation) | ||
TextView explanation; | ||
|
||
@BindView(R.id.channel_name_input) | ||
EditText nameInput; | ||
|
||
@BindView(R.id.channel_description_input) | ||
EditText descriptionInput; | ||
|
||
@BindView(R.id.btn_channel_save) | ||
Button btnSave; | ||
|
||
@BindView(R.id.channel_progress) | ||
View progressView; | ||
|
||
@BindView(R.id.channel_progress_status) | ||
TextView statusBar; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_edit_channel); | ||
|
||
String baseUrl = getString(R.string.service_url) + ":" + getString(R.string.service_port_number); | ||
String authToken = getString(R.string.service_auth_token); | ||
_service = TriblerService.createService(baseUrl, authToken); | ||
|
||
handleIntent(getIntent()); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
_service = null; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected void handleIntent(Intent intent) { | ||
String action = intent.getAction(); | ||
if (TextUtils.isEmpty(action)) { | ||
return; | ||
} | ||
switch (action) { | ||
|
||
case ACTION_CREATE_CHANNEL: | ||
btnSave.setText(getText(R.string.action_create)); | ||
explanation.setVisibility(View.VISIBLE); | ||
return; | ||
|
||
case Intent.ACTION_EDIT: | ||
String dispersyCid = intent.getStringExtra(ChannelActivity.EXTRA_DISPERSY_CID); | ||
String name = intent.getStringExtra(ChannelActivity.EXTRA_NAME); | ||
String description = intent.getStringExtra(ChannelActivity.EXTRA_DESCRIPTION); | ||
int color = MyUtils.getColor(dispersyCid.hashCode()); | ||
nameCapital.setText(MyUtils.getCapitals(name, 2)); | ||
nameInput.setText(name); | ||
descriptionInput.setText(description); | ||
MyUtils.setCicleBackground(icon, color); | ||
iconWrapper.setVisibility(View.VISIBLE); | ||
return; | ||
} | ||
} | ||
|
||
public void btnChannelSaveClicked(@Nullable View view) { | ||
// Lock input fields | ||
btnSave.setEnabled(false); | ||
nameInput.setEnabled(false); | ||
descriptionInput.setEnabled(false); | ||
|
||
// Show loading indicator | ||
progressView.setVisibility(View.VISIBLE); | ||
btnSave.setVisibility(View.GONE); | ||
|
||
String name = nameInput.getText().toString(); | ||
String description = descriptionInput.getText().toString(); | ||
|
||
if (ACTION_CREATE_CHANNEL.equals(getIntent().getAction())) { | ||
statusBar.setText(getText(R.string.status_creating_channel)); | ||
|
||
rxSubs.add(_service.createChannel(name, description) | ||
.subscribeOn(Schedulers.io()) | ||
.observeOn(AndroidSchedulers.mainThread()) | ||
.subscribe(new Observer<AddedChannelAck>() { | ||
|
||
public void onNext(AddedChannelAck ack) { | ||
} | ||
|
||
public void onCompleted() { | ||
setResult(Activity.RESULT_OK); | ||
finish(); | ||
} | ||
|
||
public void onError(Throwable e) { | ||
Log.e("btnChannelSaveClicked", "createChannel", e); | ||
// Retry | ||
btnChannelSaveClicked(null); | ||
} | ||
})); | ||
} else { | ||
|
||
rxSubs.add(_service.editMyChannel(name, description) | ||
.subscribeOn(Schedulers.io()) | ||
.observeOn(AndroidSchedulers.mainThread()) | ||
.subscribe(new Observer<ModifiedAck>() { | ||
|
||
public void onNext(ModifiedAck ack) { | ||
} | ||
|
||
public void onCompleted() { | ||
setResult(Activity.RESULT_OK); | ||
finish(); | ||
} | ||
|
||
public void onError(Throwable e) { | ||
Log.e("btnChannelSaveClicked", "editMyChannel", e); | ||
// Retry | ||
btnChannelSaveClicked(null); | ||
} | ||
})); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you did forget it after all? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are looking at the BeamActivity, not the MainActivity, but I indeed only had set it on SearchActivity before.