-
-
Notifications
You must be signed in to change notification settings - Fork 906
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
#780-[ENHANCEMENT] Replace "findViewById" by "@BindView" #788
#780-[ENHANCEMENT] Replace "findViewById" by "@BindView" #788
Conversation
Android/app/src/main/java/io/github/project_travel_mate/MainActivity.java
Outdated
Show resolved
Hide resolved
Android/app/src/main/java/io/github/project_travel_mate/MainActivity.java
Outdated
Show resolved
Hide resolved
Android/app/src/main/java/io/github/project_travel_mate/MainActivity.java
Outdated
Show resolved
Hide resolved
Android/app/src/main/java/io/github/project_travel_mate/SplashActivity.java
Outdated
Show resolved
Hide resolved
Android/app/src/main/java/io/github/project_travel_mate/destinations/CityFragment.java
Outdated
Show resolved
Hide resolved
@@ -81,7 +84,7 @@ protected void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.activity_hotels); | |||
|
|||
Toolbar toolbar = findViewById(R.id.toolbar); | |||
|
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.
remove this extra line
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.
dont mark the conversation resolved, if you havent taken any action against it
Android/app/src/main/java/io/github/project_travel_mate/utilities/CurrencyListViewActivity.java
Show resolved
Hide resolved
@@ -119,7 +119,7 @@ public boolean onCreateOptionsMenu(Menu menu) { | |||
|
|||
public void createCode() { | |||
|
|||
ImageView qrCodeView = findViewById(R.id.im); |
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.
where is this being initialized?
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.
??
@@ -102,4 +102,4 @@ private void onItemAutocompleteItemSelected() { | |||
this.setSelectedText(TimeZone.getTimeZone(this.mAutoCompleteTextViewTimezone.getText().toString())); | |||
} | |||
|
|||
} | |||
} |
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.
remove this file
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.
??
Android/app/src/main/java/io/github/project_travel_mate/utilities/TimezoneListViewActivity.java
Show resolved
Hide resolved
removed import butterknife.Optional;
Removed unused butterknife import
…mes for default fields
@BindView(R.id.toolbar) | ||
Toolbar toolbar; | ||
@BindView(R.id.drawer_layout) | ||
DrawerLayout Drawer; |
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.
variable names shouldnt start with capital letter
drawerlayout
@BindView(R.id.drawer_layout) | ||
DrawerLayout Drawer; | ||
@BindView(R.id.nav_view) | ||
NavigationView NavigationView; |
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.
here also
@@ -19,6 +17,7 @@ | |||
|
|||
@Override | |||
protected void onCreate(Bundle savedInstanceState) { | |||
|
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.
I dont see any relevant change in this file. Please remove this from commit
|
||
private MaterialSearchView mMaterialSearchView; | ||
|
||
// private MaterialSearchView MaterialSearchView; |
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.
remove this line
@@ -72,8 +73,11 @@ | |||
LottieAnimationView animationView; | |||
@BindView(R.id.cities_list) | |||
ListView lv; | |||
@BindView(R.id.search_view) | |||
MaterialSearchView MaterialSearchView; |
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.
change for all places - shouldnt start with capital letter
setSupportActionBar(toolbar); | ||
|
||
ButterKnife.bind(this); | ||
|
||
mHandler = new Handler(Looper.getMainLooper()); | ||
mMap = findViewById(R.id.map); | ||
// mMap = findViewById(R.id.map); |
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.
remove this line
@@ -119,7 +119,7 @@ public boolean onCreateOptionsMenu(Menu menu) { | |||
|
|||
public void createCode() { | |||
|
|||
ImageView qrCodeView = findViewById(R.id.im); |
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.
??
@@ -102,4 +102,4 @@ private void onItemAutocompleteItemSelected() { | |||
this.setSelectedText(TimeZone.getTimeZone(this.mAutoCompleteTextViewTimezone.getText().toString())); | |||
} | |||
|
|||
} | |||
} |
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.
??
mAnalogHour = findViewById(R.id.hour); | ||
mAnalogMinute = findViewById(R.id.minute); | ||
mAnalogSecond = findViewById(R.id.second); | ||
// |
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.
remove line
@BindView(R.id.minute) | ||
AppCompatImageView AnalogMinute; | ||
@BindView(R.id.second) | ||
AppCompatImageView AnalogSecond; |
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.
no variable name should start with capital letter
Closing this due to inactivity. @hafiz703 reopen this if you address the comments. |
Description
Fixed most implementations of findviewById to @BindView in activities except those in ViewGroups / Fragments.
Fixes #780
Type of change
Just put an x in the [] which are valid.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
./gradlew assembleDebug assembleRelease
./gradlew checkstyle
Checklist: