feature_board_view #28

Merged
norangebit merged 19 commits from feature_board_view into develop 2020-01-16 18:33:24 +00:00
2 changed files with 18 additions and 15 deletions
Showing only changes of commit 819161d0a5 - Show all commits

View File

@ -71,7 +71,6 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:runner:1.2.0'

where this dependency has been used?

where this dependency has been used?
Review

this dependecies are not used, I delete them.

this dependecies are not used, I delete them.
androidTestImplementation 'androidx.test:rules:1.2.0' androidTestImplementation 'androidx.test:rules:1.2.0'
@ -82,5 +81,4 @@ dependencies {
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.androidxArchVersion" androidTestImplementation "androidx.arch.core:core-testing:$rootProject.androidxArchVersion"
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion" androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"
testImplementation 'org.mockito:mockito-core:2.19.0'
} }

View File

@ -50,26 +50,16 @@ public class BoardViewActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_board_view); setContentView(R.layout.activity_board_view);
myToolbar = findViewById(R.id.my_toolbar);
findViews();
setSupportActionBar(myToolbar); setSupportActionBar(myToolbar);
swipeRefreshLayout = findViewById(R.id.pullToRefresh);
swipeRefreshLayout.setRefreshing(false); swipeRefreshLayout.setRefreshing(false);
Intent i = getIntent(); Intent i = getIntent();
idBoard = i.getStringExtra("idBoard"); idBoard = i.getStringExtra("idBoard");
Review

I think it would be better to group all these findViewById in one function to make the code more readable.

I think it would be better to group all these `findViewById` in one function to make the code more readable.
Review

ok, I review it

ok, I review it
getListsButton = findViewById(R.id.getLists);
description = findViewById(R.id.descriptionTxt);
members = findViewById(R.id.membersTxt);
permission = findViewById(R.id.permissionTxt);
creationDate = findViewById(R.id.createdDate);
lastModificationDate = findViewById(R.id.modifiedDate);
divider1 = findViewById(R.id.divider1);
divider2 = findViewById(R.id.divider2);
divider3 = findViewById(R.id.divider3);
listView = findViewById(R.id.listViewID);
sp = new SharedPreferenceHelper(this); sp = new SharedPreferenceHelper(this);
sp.setBoardId(idBoard); sp.setBoardId(idBoard);
@ -95,6 +85,21 @@ public class BoardViewActivity extends AppCompatActivity {
}); });
} }
private void findViews() {
myToolbar = findViewById(R.id.my_toolbar);
getListsButton = findViewById(R.id.getLists);
description = findViewById(R.id.descriptionTxt);
members = findViewById(R.id.membersTxt);
permission = findViewById(R.id.permissionTxt);
creationDate = findViewById(R.id.createdDate);
lastModificationDate = findViewById(R.id.modifiedDate);
divider1 = findViewById(R.id.divider1);
divider2 = findViewById(R.id.divider2);
divider3 = findViewById(R.id.divider3);
listView = findViewById(R.id.listViewID);
swipeRefreshLayout = findViewById(R.id.pullToRefresh);
}
private void initializeUI(String idBoard) { private void initializeUI(String idBoard) {
service = new ServicesFactory(sp); service = new ServicesFactory(sp);
service.getBoardService().getBoard(idBoard).enqueue(new Callback<Board>() { service.getBoardService().getBoard(idBoard).enqueue(new Callback<Board>() {