Skip to content
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

Fixes part of #59: Translate binding adapter files to java [BLOCKED: #1514] #1568

Merged
merged 284 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
284 commits
Select commit Hold shift + click to select a range
6a9058a
Testing source files now build
miaboloix Jul 21, 2020
12deabe
Test files are building
miaboloix Jul 21, 2020
a8fe758
Changed to java_lite
miaboloix Jul 21, 2020
3295c12
Fixed merge conflicts
miaboloix Jul 21, 2020
3f27b22
Added EOF newlines
miaboloix Jul 21, 2020
bb1b906
Each library now has its own build rule
miaboloix Jul 21, 2020
a1bd255
Merged with utility
miaboloix Jul 21, 2020
3c6b257
Utility is now one module again
miaboloix Jul 21, 2020
30a8ac2
Utility is now one rule
miaboloix Jul 21, 2020
a233e50
Merge branch 'stage1_bazel_utility' into stage1_bazel_testing
miaboloix Jul 21, 2020
4df473d
Resolved merge conflicts
miaboloix Jul 21, 2020
ef3e857
Changed visibility for utility_lib
miaboloix Jul 21, 2020
d107b07
Added duplicate google-services.json file to please Gradle
miaboloix Jul 21, 2020
560d2b9
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 21, 2020
ae52338
Utility tests are building and passing (except in_memory_blocking_cac…
miaboloix Jul 21, 2020
782cae9
Added android_local_test() rules for testing, building but not passing
miaboloix Jul 21, 2020
1903609
Added a test manifest for testing module
miaboloix Jul 21, 2020
67deaa7
Oppia_android_test is working
miaboloix Jul 21, 2020
af82414
Utility_test is now working
miaboloix Jul 21, 2020
219ea6e
Testing_test.bzl is now working
miaboloix Jul 21, 2020
8562a4d
changed all android_local_test rules to utility_test rules
miaboloix Jul 21, 2020
5d6dd40
Named test rules correctly
miaboloix Jul 21, 2020
3d21443
Added missing dependency, all tests now pass
miaboloix Jul 22, 2020
761c0c5
Removed all unused dependencies
miaboloix Jul 22, 2020
d4d40c2
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Jul 22, 2020
94213cd
Changed event_logger.proto to oppia_logger.proto
miaboloix Jul 22, 2020
5aaf72f
Merge branch 'stage1_bazel' of https://github.com/oppia/oppia-android…
miaboloix Jul 22, 2020
b718dd1
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 22, 2020
6d8740d
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Jul 22, 2020
24e8537
Added missing EOF newlines
miaboloix Jul 22, 2020
7c1ddf8
Fixed visibility
miaboloix Jul 22, 2020
33ff930
Initial BUILD file added
miaboloix Jul 22, 2020
08ed2dc
Remove addressed TODOs
miaboloix Jul 22, 2020
56227bf
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Jul 22, 2020
9505de2
Started writing build rule
miaboloix Jul 22, 2020
e1ce0d1
Fixed bug in import statements for exploration.proto, topic.proto, an…
miaboloix Jul 22, 2020
8f34cfe
Merge branch 'stage1_bazel' of https://github.com/oppia/oppia-android…
miaboloix Jul 22, 2020
1999cf1
Merged with stage1_bazel_utility
miaboloix Jul 22, 2020
23cd84a
Deleted DemoJava
miaboloix Jul 22, 2020
788bcf3
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 22, 2020
1413ad1
Fixed merge conflicts
miaboloix Jul 22, 2020
052f3cd
Domain source files build
miaboloix Jul 22, 2020
2981277
Removed unused dependencies in domain_lib
miaboloix Jul 22, 2020
17dc39a
Working on building domain test files
miaboloix Jul 22, 2020
999b3f8
Added a test manifest
miaboloix Jul 23, 2020
47d4e0c
Test files now build
miaboloix Jul 23, 2020
89307b1
Added test rules, some tests not building or passing
miaboloix Jul 23, 2020
25e9c73
Added data attribute to test macros
miaboloix Jul 23, 2020
461d249
All tests now build, some do not pass
miaboloix Jul 23, 2020
67fee18
CHanged rules_kotlin version
miaboloix Jul 23, 2020
4865d01
All tests now pass
miaboloix Jul 23, 2020
ab9e295
Firebase dependency errors have been resolved
miaboloix Jul 24, 2020
c6bbbf4
Save firebase dependency fixes for new PR
miaboloix Jul 24, 2020
5c1b4dd
Fixed typo
miaboloix Jul 24, 2020
48eb9be
Added Firebase dependencies
miaboloix Jul 24, 2020
31eb543
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 24, 2020
c466d3c
Removed AsyncResultTest example
miaboloix Jul 24, 2020
a5e9039
Removed AsynchResultTest example
miaboloix Jul 24, 2020
99d43f2
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 24, 2020
75c7774
Resolved merge conflicts
miaboloix Jul 24, 2020
b6240df
Firebase dependencies added
miaboloix Jul 24, 2020
336237b
Resolve merge conflicts
miaboloix Jul 24, 2020
8d6b28f
Removed unnecessary comments in WORKSPACE and moved rules_kotlin
miaboloix Jul 27, 2020
d712b5e
Added re-naming TODOs
miaboloix Jul 27, 2020
3105144
Renamed java_proto rules java_proto_lite
miaboloix Jul 27, 2020
2f50207
Added doc comments to model/BUILD.bazel and format_import_proto_library
miaboloix Jul 27, 2020
323a0cb
Added comments to WORKSPACE file
miaboloix Jul 27, 2020
7ce51a9
Merge branch 'stage1_bazel' of https://github.com/oppia/oppia-android…
miaboloix Jul 27, 2020
d87c95c
Fixed nits
miaboloix Jul 27, 2020
20d2c5d
Added comment to kt_android_library() rule
miaboloix Jul 27, 2020
9857eaf
Fixed more nits
miaboloix Jul 27, 2020
1a35aad
Fixed merge conflicts
miaboloix Jul 27, 2020
522993f
Added Firebase comment
miaboloix Jul 27, 2020
f5abd8e
Fixed merge conflicts
miaboloix Jul 27, 2020
dfa8e0b
Fixed merge conflicts and nits
miaboloix Jul 27, 2020
9789204
Deleted unused dependencies from testing_main_lib
miaboloix Jul 27, 2020
41d5ed1
Fixed merge conflicts
miaboloix Jul 27, 2020
ec75eda
Fixed nits and error with testing lib dependencies
miaboloix Jul 27, 2020
d8f54a7
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Jul 27, 2020
f9ac84f
Removed printStackTrace()
miaboloix Jul 27, 2020
a7c6a53
Removed addressed TODOs, all tests pass
miaboloix Jul 27, 2020
b618e18
Removed redundant public modifier
miaboloix Jul 27, 2020
364435d
Changed library name to model
miaboloix Jul 28, 2020
7e61655
Formatted WORKSPACE comment
miaboloix Jul 28, 2020
9773e66
Formatted TODO statement
miaboloix Jul 28, 2020
9fc0d53
Changed format_import_proto_library comment
miaboloix Jul 28, 2020
fdcb154
Added EOF newline
miaboloix Jul 28, 2020
8185bdd
Created Issue and linked TODO in WORKSPACE
miaboloix Jul 28, 2020
3d21d6f
Edited model BUILD file top comment
miaboloix Jul 28, 2020
8e368b4
Addressed nits
miaboloix Jul 28, 2020
29f19dd
Fixed merge conflicts
miaboloix Jul 28, 2020
af7832b
Fixed nits and added comments
miaboloix Jul 28, 2020
8fb1541
Fixing nits
miaboloix Jul 28, 2020
2b9d7c6
Deleted unnecessary dependencies and testing example file
miaboloix Jul 28, 2020
980ca88
Fixed manifest issues
miaboloix Jul 28, 2020
a63ad7f
Move google json file
miaboloix Jul 28, 2020
fff3d89
Restore app version of json
miaboloix Jul 28, 2020
54a7728
Merge branch 'test-git-copy' into stage1_bazel_utility
miaboloix Jul 28, 2020
c7cad13
Edit TODO
miaboloix Jul 28, 2020
654328e
Deleted TODO
miaboloix Jul 28, 2020
a842aec
Changed Firebase comment
miaboloix Jul 28, 2020
146f48a
Fixed merge conflicts
miaboloix Jul 28, 2020
9360972
Added testing functionality from later PR
miaboloix Jul 29, 2020
705d195
Added comments to bzl files
miaboloix Jul 29, 2020
2b7be73
Added targetSDK to manifests
miaboloix Jul 29, 2020
0621744
Changed crashlytics_lib to crashlytics
miaboloix Jul 29, 2020
54ec7fb
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 29, 2020
af931e9
Changed testing_tests visibility
miaboloix Jul 29, 2020
d5ae13c
Fixed merge conflicts
miaboloix Jul 29, 2020
4f8e77f
Added comment to utility_test.bzl
miaboloix Jul 29, 2020
0b9c14a
Changed type of comment ticks
miaboloix Jul 29, 2020
0291f7a
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Jul 29, 2020
17c92b3
Fixed typos and all tests pass
miaboloix Jul 29, 2020
fc7170f
Removed empty line
miaboloix Jul 29, 2020
acbd392
Fixed merge conflicts
miaboloix Jul 29, 2020
dc8ad13
Fixed errors from merge
miaboloix Jul 29, 2020
53828c0
Added comments to data and domain BUILD files
miaboloix Jul 29, 2020
578ef76
Fixed indentation in domain_test
miaboloix Jul 29, 2020
65eaa1d
Removed commented-out dependencies
miaboloix Jul 29, 2020
32ce87a
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Jul 29, 2020
65f13c1
Fixed nits and added TODOs
miaboloix Jul 29, 2020
b6dd154
Merge branch 'stage1_bazel' of https://github.com/oppia/oppia-android…
miaboloix Jul 29, 2020
a4ec778
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 29, 2020
f466e8f
Added Args to document comment
miaboloix Jul 29, 2020
3638d43
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Jul 30, 2020
58752b4
Changed targetSDK to 29
miaboloix Jul 30, 2020
705355c
Merge branch 'stage1_bazel' of https://github.com/oppia/oppia-android…
miaboloix Jul 30, 2020
d152713
Formatted TODO
miaboloix Jul 30, 2020
fb515ec
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Jul 30, 2020
11d84f4
Fixed merge conflicts
miaboloix Jul 30, 2020
e252feb
Fixed merge conflicts
miaboloix Jul 30, 2020
01fd0c9
Added root BUILD file
miaboloix Jul 30, 2020
cc06b5a
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Jul 30, 2020
74e4e52
Moved google-services.json
miaboloix Jul 30, 2020
0c9d197
Added gogle-services.json back to app
miaboloix Jul 30, 2020
72e0acd
Trying to remove combined testing library
miaboloix Jul 31, 2020
0aa646d
Changed targetSDK to 29
miaboloix Aug 3, 2020
7660d7d
Tests pass now with deps passed in.
miaboloix Aug 3, 2020
8aa8c59
Created TEST_DEPS list to avoid duplicate list of dependencies
miaboloix Aug 3, 2020
d4f53c4
Removed unused resources and manifest
miaboloix Aug 3, 2020
a275d9c
Updated comments to reflect changes
miaboloix Aug 3, 2020
56f0232
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 3, 2020
b2b4e62
Changed deps to be a parameter, changed targetSDK back to 28 because …
miaboloix Aug 3, 2020
7043491
Fixed indentation in utility/BUILD
miaboloix Aug 3, 2020
7fa41db
Updated comment for utility_test.bzl
miaboloix Aug 3, 2020
297cfa1
Updated comment for testing_test
miaboloix Aug 3, 2020
51bcc06
Formatted dependencies and removed unused dependency
miaboloix Aug 3, 2020
ab8ea0b
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Aug 3, 2020
f906dd6
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 3, 2020
fd4386f
Updated dependency list
miaboloix Aug 3, 2020
0d1bd33
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Aug 3, 2020
33d8e2a
Header for oppia_android_test now fits on one line
miaboloix Aug 3, 2020
781fe7b
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 3, 2020
47e1592
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Aug 3, 2020
02efdca
Simplifies comment on domain/BUILD file
miaboloix Aug 3, 2020
f02a1d7
Changed cache_store to persistent_cache_store
miaboloix Aug 3, 2020
b911cc2
Removed glob() from data BUILD file
miaboloix Aug 3, 2020
1294d08
Edited documentation for oppia_android_test
miaboloix Aug 3, 2020
b0637dc
Updated documentation for utility and testing BUILD files
miaboloix Aug 3, 2020
122f451
Changed src to srcs
miaboloix Aug 3, 2020
a019e5f
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 3, 2020
c45f649
Changed src to srcs
miaboloix Aug 3, 2020
e236dac
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Aug 3, 2020
02db08d
All dragAndDrop tests now pass, stateRetreiverTest fails
miaboloix Aug 3, 2020
425049a
Created java files for binding adapters
miaboloix Aug 5, 2020
28de63e
Translated DrawableDinsingAdapter
miaboloix Aug 5, 2020
e0b83f8
Traslated EditTextBindingAdapter
miaboloix Aug 5, 2020
c2a278f
Translated ImageViewBindingAdapters
miaboloix Aug 5, 2020
e3da795
Translated MarginBindingAdapters
miaboloix Aug 5, 2020
6ed785b
Translated TextViewBindingAdapters
miaboloix Aug 5, 2020
b98fe78
Translated RecyclerViewBindingAdapter
miaboloix Aug 5, 2020
84037cb
Deleted kotlin binding adapters
miaboloix Aug 5, 2020
ce92d0a
Translated GuidelineBindingAdapter
miaboloix Aug 5, 2020
88c9492
Translated StateAssemblerMarginBindingAdapters
miaboloix Aug 5, 2020
d66af07
Translated StateAssemblerPaddingBindingAdapters
miaboloix Aug 5, 2020
fc51d3a
Almost finished translating ViewBindingAdapter
miaboloix Aug 5, 2020
84e5051
Fixed the duplicate google-services.json issue
miaboloix Aug 6, 2020
3c0932d
Created Issue and added TODO
miaboloix Aug 6, 2020
f1f7b1d
Translated ViewBindingAdapter
miaboloix Aug 6, 2020
b5b20f9
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Aug 6, 2020
714ffa2
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Aug 6, 2020
83747a1
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 6, 2020
62a2fa7
Added minSDK back
miaboloix Aug 6, 2020
8eac40c
Alphabetized dependencies
miaboloix Aug 6, 2020
48e4593
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 6, 2020
9578f27
Fixed firebase target
miaboloix Aug 6, 2020
75aca29
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Aug 6, 2020
e72b6ef
Trying to fix StateRetreiverTest
miaboloix Aug 6, 2020
3855305
Merge branch 'introduce-domain-bazel-build' of https://github.com/opp…
miaboloix Aug 6, 2020
1a51990
Binding Adapter files are building with Gradle!
miaboloix Aug 6, 2020
dbb08ab
Fixed ktlint violation
miaboloix Aug 6, 2020
bc504b2
Merge branch 'introduce-domain-bazel-build' of https://github.com/opp…
miaboloix Aug 6, 2020
3d1d42f
Revert "Deleted kotlin binding adapters"
miaboloix Aug 7, 2020
c6d34c7
Revert "Translated GuidelineBindingAdapter"
miaboloix Aug 7, 2020
2dadc50
Revert "Translated StateAssemblerMarginBindingAdapters"
miaboloix Aug 7, 2020
b9e1283
Revert "Translated StateAssemblerPaddingBindingAdapters"
miaboloix Aug 7, 2020
39d9bce
Git mv on DrawableBindingAdapters
miaboloix Aug 7, 2020
a3a852e
Translated DrawableBindingAdapters
miaboloix Aug 7, 2020
8f16ca7
Deleted java files
miaboloix Aug 7, 2020
5ba5d0f
Translated EditTextBA and GuidelineBA
miaboloix Aug 7, 2020
af81849
Translated ImageViewBA
miaboloix Aug 7, 2020
f5c4baa
Added missing semicolon
miaboloix Aug 7, 2020
85e279c
Translated MarginBindingAdapters
miaboloix Aug 7, 2020
7de67e3
Translated State AssemblerMarginBA
miaboloix Aug 7, 2020
48ecefc
Translated StateAssemblerPaddingBA
miaboloix Aug 7, 2020
849549d
Translated TextViewBA
miaboloix Aug 7, 2020
6cfa75d
Revert "Translated TextViewBA"
miaboloix Aug 7, 2020
a1843d2
Changed targetSdk to 28
miaboloix Aug 7, 2020
29a81df
Revert "Revert "Translated TextViewBA""
miaboloix Aug 9, 2020
8c9f4b2
Fixed formatting issues and changed NotNull to NonNull
miaboloix Aug 9, 2020
4a68e95
Refactored GuidelineBindingAdapter to be GuidelineBindingAdapters
miaboloix Aug 9, 2020
0090709
Fixed some double space errors and other typos
miaboloix Aug 9, 2020
5aa364f
Added missing ViewBindingAdapter
miaboloix Aug 9, 2020
3be3193
Deleted extra spaces and fixed more nit issues
miaboloix Aug 9, 2020
766d699
Made all classes final
miaboloix Aug 9, 2020
96fbade
Added top level documentation
miaboloix Aug 9, 2020
8881d0f
Reformatted some comments to fit java style
miaboloix Aug 9, 2020
0f4ef4f
Reformatted imports
miaboloix Aug 9, 2020
0cf3415
Merge branch 'develop' into stage1_bazel_utility
miaboloix Aug 9, 2020
5f90f7b
Merge branch 'stage1_bazel_utility' of https://github.com/oppia/oppia…
miaboloix Aug 9, 2020
44236da
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Aug 9, 2020
00b9fb4
Merge branch 'stage1_bazel_testing' of https://github.com/oppia/oppia…
miaboloix Aug 9, 2020
c400b2c
Merge branch 'introduce-bazel-roboelectric-testing' of https://github…
miaboloix Aug 9, 2020
7f5deea
Created Issue and added TODOs for re-restricitng access
miaboloix Aug 9, 2020
2b1db0d
Added min and target SDK to domain manifest
miaboloix Aug 9, 2020
d0ba983
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Aug 9, 2020
ea31be3
Merge branch 'introduce-domain-bazel-build' of https://github.com/opp…
miaboloix Aug 9, 2020
3129710
Added documentation comment
miaboloix Aug 9, 2020
65e71cc
Deleted unused domain_tests library
miaboloix Aug 9, 2020
67b467d
Revert "Deleted unused domain_tests library"
miaboloix Aug 9, 2020
8c3d0f0
Removed unused domain)tests library
miaboloix Aug 9, 2020
20aae5a
Merge branch 'introduce-domain-bazel-build' of https://github.com/opp…
miaboloix Aug 9, 2020
84b6125
Formatted files and added missing @NonNull annotations
miaboloix Aug 10, 2020
b99d771
Revert "Formatted files and added missing @NonNull annotations"
miaboloix Aug 10, 2020
2d81db0
Added documentation, created an issue, added a TODO
miaboloix Aug 11, 2020
1d94b22
Merge branch 'introduce-domain-bazel-build' of https://github.com/opp…
miaboloix Aug 11, 2020
55daaec
Formatted single line comments
miaboloix Aug 11, 2020
dfb244e
Fixing more nits
miaboloix Aug 11, 2020
bd4c9c5
Fixed more nits.
miaboloix Aug 11, 2020
e3f02a8
Fixed getTimeAgo() function
miaboloix Aug 11, 2020
9558875
Suppressed warning in bindToRecyclerViewAdapter
miaboloix Aug 11, 2020
b16f979
Added assets
miaboloix Aug 12, 2020
4e4aed7
Fixed nits in TextViewBA
miaboloix Aug 12, 2020
9bd52af
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Aug 12, 2020
78ffb0b
Testing module tests now pass, all domain tests pass except StateRetr…
miaboloix Aug 13, 2020
16e1741
Merge branch 'introduce-domain-bazel-build' of https://github.com/opp…
miaboloix Aug 13, 2020
26284cb
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
miaboloix Aug 17, 2020
30ad075
Update app/src/main/java/org/oppia/app/databinding/TextViewBindingAda…
miaboloix Aug 17, 2020
320e492
Made nit changes to TextViewBA
miaboloix Aug 17, 2020
02fa684
Merge branch 'traslate-binding-adapters-to-java' of https://github.co…
miaboloix Aug 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import android.widget.Button;

import androidx.annotation.ColorInt;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do reformat java files, can we update the code style for Java?
Specifically import part as currently, we have an empty line separator there which will look like this after reformat.

import android.graphics.drawable.GradientDrawable;
import android.view.View;
import android.widget.Button;

import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;

import org.oppia.app.R;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just went ahead and reformatted all of the files. What do you mean by 'update the code style for Java'? Do you mean update the Wiki? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With code style, I mean specific conventions for files like Java, Kotlin, XML and many more and specifying conventions for tabs and indents, spaces, wrapping and braces, and blank lines.
You can check in Android Studio -> File > Settings > Editor > Code Style (Android Studio > Preferences > Editor > Code Style on a Mac.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. So, I am guessing we don't want the empty lines, right? I just edited the code style in my Android Studio to remove the empty lines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow https://google.github.io/styleguide/javaguide.html for Java style.

import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;

import org.oppia.app.R;

/**
* Holds all the custom binding adapters that set background drawables.
*/
/** Holds all custom binding adapters that set background drawables. */
public final class DrawableBindingAdapters {
/**
* Used to set a rounded-rect background drawable with a data-bound color.
*/

/** Used to set a rounded-rect background drawable with a data-bound color. */
@BindingAdapter("app:roundedRectDrawableWithColor")
public static void setBackgroundDrawable(@NonNull View view, @ColorInt int colorRgb) {
view.setBackgroundResource(R.drawable.rounded_rect_background);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

import android.text.TextWatcher;
import android.widget.EditText;

import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;

/**
* Holds all the custom binding adapters that bind to [EditText] adapters.
*/
/** Holds all custom binding adapters that bind to [EditText]. */
public final class EditTextBindingAdapters {
/**
* Binding adapter for setting a [TextWatcher] as a change listener for an [EditText].
*/

/** Binding adapter for setting a [TextWatcher] as a change listener for an [EditText] */
@BindingAdapter("app:textChangedListener")
public static void bindTextWatcher(@NonNull EditText editText, TextWatcher textWatcher) {
editText.addTextChangedListener(textWatcher);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package org.oppia.app.databinding;

import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.Guideline;
import androidx.constraintlayout.widget.ConstraintLayout;
anandwana001 marked this conversation as resolved.
Show resolved Hide resolved
import androidx.constraintlayout.widget.Guideline;
import androidx.databinding.BindingAdapter;

/**
* Holds all the custom binding adapters that bind to [Guideline].
*/
/** Holds all custom binding adapters that bind to [Guideline]. */
public final class GuidelineBindingAdapters {
/**
* Binding adapter for setting the `guidePercent` for a [Guideline].
*/

/** Binding adapter for setting the `guidePercent` for a [Guideline]. */
@BindingAdapter("app:layout_constraintGuide_percent")
public static void setGuidelinePercentage(@NonNull Guideline guideline, float percentage) {
ConstraintLayout.LayoutParams params =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;

import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;

import org.oppia.app.R;
import org.oppia.app.model.LessonThumbnailGraphic;
import org.oppia.app.model.ProfileAvatar;

/**
* Holds all the custom binding adapters that bind to [ImageView] adapters.
*/
/** Holds all custom binding adapters that bind to [ImageView]. */
public final class ImageViewBindingAdapters {
/**
* Allows binding drawables to an [ImageView] via "android:src".
* Source: https://stackoverflow.com/a/35809319/3689782.
* Reference: https://stackoverflow.com/a/35809319/3689782.
*/
@BindingAdapter("android:src")
public static void setImageDrawable(@NonNull ImageView imageView, String imageUrl) {
Expand All @@ -38,7 +33,7 @@ public static void setImageDrawable(@NonNull ImageView imageView, String imageUr

/**
* Allows binding drawables to an [ImageView] via "android:src".
* Source: https://stackoverflow.com/a/35809319/3689782.
* Reference: https://stackoverflow.com/a/35809319/3689782.
*/
@BindingAdapter("android:src")
public static void setImageDrawable(
Expand All @@ -50,6 +45,7 @@ public static void setImageDrawable(

/**
* Binds the specified [LessonThumbnailGraphic] as the source for the [ImageView].
*
* The view should be specified to have no width/height (when sized in a constraint layout), and
BenHenning marked this conversation as resolved.
Show resolved Hide resolved
* use centerCrop for the image to appear correctly.
*/
Expand Down Expand Up @@ -111,8 +107,8 @@ public static void setImageDrawable(
* Binding adapter for profile images. Used to either display a local image or custom
* colored avatar.
*
* @param imageView View where the profile avatar will be loaded into.
* @param profileAvatar Represents either a colorId or local image uri.
* @param imageView view where the profile avatar will be loaded into
* @param profileAvatar represents either a colorId or local image uri
*/
@BindingAdapter("profile:src")
public static void setProfileImage(ImageView imageView, ProfileAvatar profileAvatar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;

import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;

/**
* Holds all the custom binding adapters that set margin values.
*/
/** Holds all custom binding adapters that set margin values. */
public final class MarginBindingAdapters {
/**
* Used to set a margin-start for views.
*/

/** Used to set a margin-start for views. */
@BindingAdapter("app:layoutMarginStart")
public static void setLayoutMarginStart(@NonNull View view, float marginStart) {
if (view.getLayoutParams() instanceof MarginLayoutParams) {
Expand All @@ -27,9 +23,7 @@ public static void setLayoutMarginStart(@NonNull View view, float marginStart) {
}
}

/**
* Used to set a margin-end for views.
*/
/** Used to set a margin-end for views. */
@BindingAdapter("app:layoutMarginEnd")
public static void setLayoutMarginEnd(@NonNull View view, float marginEnd) {
if (view.getLayoutParams() instanceof MarginLayoutParams) {
Expand All @@ -44,9 +38,7 @@ public static void setLayoutMarginEnd(@NonNull View view, float marginEnd) {
}
}

/**
* Used to set a margin-top for views.
*/
/** Used to set a margin-top for views. */
@BindingAdapter("app:layoutMarginTop")
public static void setLayoutMarginTop(@NonNull View view, float marginTop) {
if (view.getLayoutParams() instanceof MarginLayoutParams) {
Expand All @@ -61,9 +53,7 @@ public static void setLayoutMarginTop(@NonNull View view, float marginTop) {
}
}

/**
* Used to set a margin-bottom for views.
*/
/** Used to set a margin-bottom for views. */
@BindingAdapter("app:layoutMarginBottom")
public static void setLayoutMarginBottom(@NonNull View view, float marginBottom) {
if (view.getLayoutParams() instanceof MarginLayoutParams) {
Expand All @@ -78,9 +68,7 @@ public static void setLayoutMarginBottom(@NonNull View view, float marginBottom)
}
}

/**
* Used to set a margin for views.
*/
/** Used to set a margin for views. */
@BindingAdapter("app:layoutMargin")
public static void setLayoutMargin(@NonNull View view, float margin) {
if (view.getLayoutParams() instanceof MarginLayoutParams) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;

import androidx.databinding.BindingAdapter;

/**
* Holds all the custom binding adapters that set margin values for exploration view, exploration
* Holds all custom binding adapters that set margin values for exploration view, exploration
* split-veiw, question view, and question split-view.
*/
public final class StateAssemblerMarginBindingAdapters {
/**
* Used to set a margin for exploration split-view.
*/

/** Used to set a margin for exploration split-view. */
@BindingAdapter(
value = {
"app:explorationSplitViewMarginApplicable",
Expand All @@ -34,9 +32,7 @@ public static void setExplorationSplitViewMargin(
setMarginIfApplicable(view, isApplicable, marginStart, marginTop, marginEnd, marginBottom);
}

/**
* Used to set a margin for exploration view.
*/
/** Used to set a margin for exploration view. */
@BindingAdapter(
value = {
"app:explorationViewMarginApplicable",
Expand All @@ -58,9 +54,7 @@ public static void setExplorationViewMargin(
setMarginIfApplicable(view, isApplicable, marginStart, marginTop, marginEnd, marginBottom);
}

/**
* Used to set a margin for question view.
*/
/** Used to set a margin for question view. */
@BindingAdapter(
value = {
"app:questionViewMarginApplicable",
Expand All @@ -82,9 +76,7 @@ public static void setQuestionViewMargin(
setMarginIfApplicable(view, isApplicable, marginStart, marginTop, marginEnd, marginBottom);
}

/**
* Used to set a margin for question split-view.
*/
/** Used to set a margin for question split-view. */
@BindingAdapter(
value = {
"app:questionSplitViewMarginApplicable",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package org.oppia.app.databinding;

import android.view.View;

import androidx.databinding.BindingAdapter;

/**
* Holds all the custom binding adapters that set padding values for exploration view, exploration
* Holds all custom binding adapters that set padding values for exploration view, exploration
* split-veiw, question view, and question split-view.
*/
public final class StateAssemblerPaddingBindingAdapters {
/**
* Used to set a padding for exploration split-view.
*/

/** Used to set a padding for exploration split-view. */
@BindingAdapter(
value = {
"app:explorationSplitViewPaddingApplicable",
Expand All @@ -33,9 +31,7 @@ public static void setExplorationSplitViewPadding(
setPaddingIfApplicable(view, isApplicable, paddingStart, paddingTop, paddingEnd, paddingBottom);
}

/**
* Used to set a padding for exploration view.
*/
/** Used to set a padding for exploration view. */
@BindingAdapter(
value = {
"app:explorationViewPaddingApplicable",
Expand All @@ -57,9 +53,7 @@ public static void setExplorationViewPadding(
setPaddingIfApplicable(view, isApplicable, paddingStart, paddingTop, paddingEnd, paddingBottom);
}

/**
* Used to set a padding for question view.
*/
/** Used to set a padding for question view. */
@BindingAdapter(
value = {
"app:questionViewPaddingApplicable",
Expand All @@ -81,9 +75,7 @@ public static void setQuestionViewPadding(
setPaddingIfApplicable(view, isApplicable, paddingStart, paddingTop, paddingEnd, paddingBottom);
}

/**
* Used to set a padding for question split-view.
*/
/** Used to set a padding for question split-view. */
@BindingAdapter(
value = {
"app:questionSplitViewPaddingApplicable",
Expand Down
Loading