Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Resolves codestyle violation; removes checkStyle ; removes spotbug(#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
konishon committed Oct 16, 2019
1 parent d28b0e7 commit a562355
Show file tree
Hide file tree
Showing 78 changed files with 383 additions and 409 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ task checkAll(type: GradleBuild) {
}

task checkCode(type: GradleBuild) {
tasks = ['pmd', 'checkstyle', 'lintDebug', 'spotbugs']
tasks = ['pmd', 'lintDebug']
}

task checkTests(type: GradleBuild) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"formatVersion": 1,
"database": {
"version": 21,
"identityHash": "10c529a9b424519f55eafba149787072",
"identityHash": "8d85328bc10a78d4553c187be40e5a83",
"entities": [
{
"tableName": "sites",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `latitude` TEXT, `longitude` TEXT, `identifier` TEXT, `name` TEXT, `typeId` TEXT, `typeLabel` TEXT, `phone` TEXT, `address` TEXT, `publicDesc` TEXT, `additionalDesc` TEXT, `logo` TEXT, `isActive` INTEGER, `location` TEXT, `isSurvey` INTEGER, `dateCreated` TEXT, `project` TEXT, `isSiteVerified` INTEGER NOT NULL, `siteTypeError` TEXT, `metaAttributes` TEXT, `siteDocuments` TEXT, `regionId` TEXT, `site` TEXT, `generalFormDeployedFrom` TEXT, `stagedFormDeployedFrom` TEXT, `scheduleFormDeployedForm` TEXT, PRIMARY KEY(`id`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `latitude` TEXT, `longitude` TEXT, `identifier` TEXT, `name` TEXT, `typeId` TEXT, `typeLabel` TEXT, `phone` TEXT, `address` TEXT, `publicDesc` TEXT, `additionalDesc` TEXT, `logo` TEXT, `isActive` INTEGER, `location` TEXT, `isSurvey` INTEGER, `dateCreated` TEXT, `PROJECT` TEXT, `isSiteVerified` INTEGER NOT NULL, `siteTypeError` TEXT, `metaAttributes` TEXT, `siteDocuments` TEXT, `regionId` TEXT, `site` TEXT, `generalFormDeployedFrom` TEXT, `stagedFormDeployedFrom` TEXT, `scheduleFormDeployedForm` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -106,7 +106,7 @@
},
{
"fieldPath": "project",
"columnName": "project",
"columnName": "PROJECT",
"affinity": "TEXT",
"notNull": false
},
Expand Down Expand Up @@ -175,8 +175,8 @@
"foreignKeys": []
},
{
"tableName": "project",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `description` TEXT, `address` TEXT, `lat` TEXT, `lon` TEXT, `url` TEXT, `siteClusters` TEXT, `organizationName` TEXT, `organizationlogourl` TEXT, `hasClusteredSites` INTEGER, `typeId` INTEGER, `typeLabel` TEXT, `phone` TEXT, `isSyncedWithRemote` INTEGER NOT NULL, `terms_and_labels` TEXT, `regionList` TEXT, `siteMetaAttributes` TEXT, PRIMARY KEY(`id`))",
"tableName": "PROJECT",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `description` TEXT, `address` TEXT, `lat` TEXT, `lon` TEXT, `url` TEXT, `siteClusters` TEXT, `organizationName` TEXT, `organizationlogourl` TEXT, `hasClusteredSites` INTEGER, `typeId` INTEGER, `typeLabel` TEXT, `phone` TEXT, `isSyncedWithRemote` INTEGER NOT NULL, `termsAndLabels` TEXT, `regionList` TEXT, `siteMetaAttributes` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -269,8 +269,8 @@
"notNull": true
},
{
"fieldPath": "terms_and_labels",
"columnName": "terms_and_labels",
"fieldPath": "termsAndLabels",
"columnName": "termsAndLabels",
"affinity": "TEXT",
"notNull": false
},
Expand Down Expand Up @@ -893,7 +893,7 @@
},
{
"tableName": "FieldSightNotification",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `notificationType` TEXT, `notifiedDate` TEXT, `notifiedTime` TEXT, `idString` TEXT, `fsFormId` TEXT, `fsFormIdProject` TEXT, `formName` TEXT, `siteId` TEXT, `siteName` TEXT, `projectId` TEXT, `projectName` TEXT, `formStatus` TEXT, `role` TEXT, `isFormDeployed` TEXT, `details_url` TEXT, `comment` TEXT, `formType` TEXT, `isRead` INTEGER NOT NULL, `formSubmissionId` TEXT, `formVersion` TEXT, `siteIdentifier` TEXT, `receivedDateTime` TEXT, `isDeployedFromSite` INTEGER NOT NULL, `receivedDateTimeInMillis` INTEGER NOT NULL, `schedule_forms_count` TEXT)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `notificationType` TEXT, `notifiedDate` TEXT, `notifiedTime` TEXT, `idString` TEXT, `fsFormId` TEXT, `fsFormIdProject` TEXT, `formName` TEXT, `siteId` TEXT, `siteName` TEXT, `projectId` TEXT, `projectName` TEXT, `formStatus` TEXT, `role` TEXT, `isFormDeployed` TEXT, `detailsUrl` TEXT, `comment` TEXT, `formType` TEXT, `isRead` INTEGER NOT NULL, `formSubmissionId` TEXT, `formVersion` TEXT, `siteIdentifier` TEXT, `receivedDateTime` TEXT, `isDeployedFromSite` INTEGER NOT NULL, `receivedDateTimeInMillis` INTEGER NOT NULL, `schedule_forms_count` TEXT)",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -986,8 +986,8 @@
"notNull": false
},
{
"fieldPath": "details_url",
"columnName": "details_url",
"fieldPath": "detailsUrl",
"columnName": "detailsUrl",
"affinity": "TEXT",
"notNull": false
},
Expand Down Expand Up @@ -1122,7 +1122,7 @@
},
{
"tableName": "contacts",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `email` TEXT, `address` TEXT, `gender` TEXT, `phone` TEXT, `skype` TEXT, `twitter` TEXT, `tango` TEXT, `hike` TEXT, `qq` TEXT, `google_talk` TEXT, `profilePicture` TEXT, `viber` TEXT, `whatsapp` TEXT, `wechat` TEXT, `full_name` TEXT, `primary_number` TEXT, `secondary_number` TEXT, `office_number` TEXT, `roleString` TEXT)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `email` TEXT, `address` TEXT, `gender` TEXT, `phone` TEXT, `skype` TEXT, `twitter` TEXT, `tango` TEXT, `hike` TEXT, `qq` TEXT, `googleTalk` TEXT, `profilePicture` TEXT, `viber` TEXT, `whatsapp` TEXT, `wechat` TEXT, `fullName` TEXT, `primaryNumber` TEXT, `secondaryNumber` TEXT, `officeNumber` TEXT, `roleString` TEXT)",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -1191,8 +1191,8 @@
"notNull": false
},
{
"fieldPath": "google_talk",
"columnName": "google_talk",
"fieldPath": "googleTalk",
"columnName": "googleTalk",
"affinity": "TEXT",
"notNull": false
},
Expand Down Expand Up @@ -1221,26 +1221,26 @@
"notNull": false
},
{
"fieldPath": "full_name",
"columnName": "full_name",
"fieldPath": "fullName",
"columnName": "fullName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "primary_number",
"columnName": "primary_number",
"fieldPath": "primaryNumber",
"columnName": "primaryNumber",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secondary_number",
"columnName": "secondary_number",
"fieldPath": "secondaryNumber",
"columnName": "secondaryNumber",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "office_number",
"columnName": "office_number",
"fieldPath": "officeNumber",
"columnName": "officeNumber",
"affinity": "TEXT",
"notNull": false
},
Expand Down Expand Up @@ -1357,7 +1357,7 @@
"notNull": true
},
{
"fieldPath": "created_date",
"fieldPath": "createdDate",
"columnName": "created_date",
"affinity": "INTEGER",
"notNull": true
Expand Down Expand Up @@ -1527,7 +1527,7 @@
},
{
"tableName": "fieldsight_formv3",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `site` TEXT, `project` TEXT, `site_project_id` TEXT, `type` TEXT, `em` TEXT, `description` TEXT, `settings` TEXT, `formDetails` TEXT, `metaAttributes` TEXT, PRIMARY KEY(`id`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `site` TEXT, `PROJECT` TEXT, `site_project_id` TEXT, `type` TEXT, `em` TEXT, `description` TEXT, `settings` TEXT, `formDetails` TEXT, `metaAttributes` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
Expand All @@ -1543,12 +1543,12 @@
},
{
"fieldPath": "project",
"columnName": "project",
"columnName": "PROJECT",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "site_project_id",
"fieldPath": "siteProjectId",
"columnName": "site_project_id",
"affinity": "TEXT",
"notNull": false
Expand Down Expand Up @@ -1603,7 +1603,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '10c529a9b424519f55eafba149787072')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '8d85328bc10a78d4553c187be40e5a83')"
]
}
}
4 changes: 2 additions & 2 deletions collect_app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
<activity android:name="org.fieldsight.naxa.migrate.MigrateFieldSightActivity" />
<activity android:name="org.fieldsight.naxa.educational.EducationalMaterialActivity" />
<activity android:name="org.fieldsight.naxa.project.AppUpdateActivity" />
<activity android:name="org.fieldsight.naxa.educational.EduMat_ViewTextTitleDetailsActivity" />
<activity android:name="org.fieldsight.naxa.educational.EduMatViewTextTitleDetailsActivity" />
<activity android:name="org.fieldsight.naxa.educational.EduMatImageDetailsActivity" />
<activity android:name="org.fieldsight.naxa.educational.EduMat_ViewVideoDetailsActivity" />
<activity android:name="org.fieldsight.naxa.educational.EduMatViewVideoDetailsActivity" />
<activity android:name="org.fieldsight.naxa.FSInstanceUploaderListActivity" />
<activity android:name="org.fieldsight.naxa.FSInstanceChooserList" />
<activity android:name="org.fieldsight.naxa.sync.ContentDownloadActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Pair tappedIdLabelPair = filterOption.getOptions().get(position);
if (tappedIdLabelPair != null)
if (tappedIdLabelPair != null){
filterOption.setSelection(tappedIdLabelPair);
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public String getLastPathComponent(String filePath) {
if (segments.length == 0) {
return "";
}
String lastPathComponent = segments[segments.length - 1];
return lastPathComponent;
return segments[segments.length - 1];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import timber.log.Timber;


public abstract class BaseRecyclerViewAdapter<L, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {
public abstract class BaseRecyclerViewAdapter<L, H extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<H> {
private final List<L> l;
private final int layout;

Expand All @@ -24,13 +24,13 @@ protected BaseRecyclerViewAdapter(List<L> l, int layout) {

@NonNull
@Override
public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
public H onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(layout, parent, false);
return attachViewHolder(view);
}

@Override
public void onBindViewHolder(@NonNull VH holder, int position) {
public void onBindViewHolder(@NonNull H holder, int position) {
viewBinded(holder, l.get(position));
}

Expand All @@ -43,9 +43,9 @@ public int getItemCount() {
return l.size();
}

public abstract void viewBinded(VH vh, L l);
public abstract void viewBinded(H vh, L l);

public abstract VH attachViewHolder(View view);
public abstract H attachViewHolder(View view);


}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
@Override
public void onBindViewHolder( final MyViewHolder holder, int position) {
final FieldSightContactModel contact = contactList.get(position);
holder.tvFullName.setText(contact.getFull_name());
holder.tvFullName.setText(contact.getFullName());
holder.tvUserName.setText(contact.getEmail());
/*
//open tvSkype
Expand Down Expand Up @@ -137,11 +137,11 @@ public void onClick(View v) {
}
});
*/
String Img_Thumb_Url = contact.getProfilePicture();
String profilePicture = contact.getProfilePicture();

if (Img_Thumb_Url != null) {
if (profilePicture != null) {
GlideApp.with(context)
.load(Img_Thumb_Url)
.load(profilePicture)
.circleCrop()
.thumbnail(0.5f)
.into(holder.ivProfilePicture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void ContactDetailToViews() {
.into(profilePicture);
}

BindAndSetOrHide(fullname, R.id.tv_contactdetail_fullname, contactDetail.getFull_name());
BindAndSetOrHide(fullname, R.id.tv_contactdetail_fullname, contactDetail.getFullName());

BindAndSetOrHide(username, R.id.tv_contactdetail_username, contactDetail.getUsername());

Expand All @@ -74,7 +74,7 @@ private void ContactDetailToViews() {

BindAndSetOrHide(qq, R.id.tv_contactdetail_qq, contactDetail.getQq(), R.id.iv_qq_icon);

BindAndSetOrHide(googletalk, R.id.tv_contactdetail_googletalk, contactDetail.getGoogle_talk(), R.id.iv_googletalk_icon);
BindAndSetOrHide(googletalk, R.id.tv_contactdetail_googletalk, contactDetail.getGoogleTalk(), R.id.iv_googletalk_icon);

BindAndSetOrHide(viber, R.id.tv_contactdetail_viber, contactDetail.getViber(), R.id.iv_viber_icon);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class ContactLocalSource implements BaseLocalDataSource<FieldSightContactModel> {

private static ContactLocalSource INSTANCE;
private static ContactLocalSource contactLocalSource;
private final ContacstDao dao;


Expand All @@ -24,10 +24,10 @@ private ContactLocalSource() {


public synchronized static ContactLocalSource getInstance() {
if (INSTANCE == null) {
INSTANCE = new ContactLocalSource();
if (contactLocalSource == null) {
contactLocalSource = new ContactLocalSource();
}
return INSTANCE;
return contactLocalSource;
}


Expand Down
Loading

0 comments on commit a562355

Please sign in to comment.