Skip to content

Commit

Permalink
Merge pull request #105 from Zolon-DOL/master
Browse files Browse the repository at this point in the history
Sprint 3 changes
  • Loading branch information
pbhatt17 authored Jul 30, 2021
2 parents 3061cd2 + b9fa818 commit 50c8a31
Show file tree
Hide file tree
Showing 6 changed files with 6,957 additions and 7,124 deletions.
14,024 changes: 6,920 additions & 7,104 deletions app/src/main/assets/countries_2020.xml

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions app/src/main/assets/goods_2019.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2603,13 +2603,13 @@
</Good>
<Good>
<Good_Name>Polysilicon</Good_Name>
<Good_Sector>Polysilicon</Good_Sector>
<Good_Sector>Manufacturing</Good_Sector>
<Countries>
<Country>
<Country_Name>China</Country_Name>
<Country_Region />
<Child_Labor>Yes</Child_Labor>
<Forced_Labor>No</Forced_Labor>
<Child_Labor>No</Child_Labor>
<Forced_Labor>Yes</Forced_Labor>
<Forced_Child_Labor>No</Forced_Child_Labor>
</Country>
</Countries>
Expand Down Expand Up @@ -4007,5 +4007,4 @@
</Country>
</Countries>
</Good>

</Goods>
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import android.graphics.Color;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import java.util.Arrays;
import java.util.Hashtable;

Expand Down Expand Up @@ -118,7 +118,8 @@ private void displayTerritories(LinearLayout layout, Country.TerritoryStandard s
}

private void displayStandard(TextView view, Country.Standard standard) {
displayValue(view, standard.type, standard.value, standard.age, standard.calculatedAge, standard.conformsStandard);
if(standard!=null)
displayValue(view, standard.type, standard.value, standard.age, standard.calculatedAge, standard.conformsStandard);
}

private void displayValue(TextView view, String type, String standard, String age, String calculatedAgeString, String conformsStandardString) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package gov.dol.childlabor;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

public class SuggestedActionsActivity extends AppCompatActivity {

@Override
Expand All @@ -25,7 +26,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (country.getSuggestedActions().length > 0) {
suggestedActionsLinearLayout.removeAllViews();
}
Country.SuggestedAction[] sortedSuggestedAction = country.getSuggestedActions();
/*Country.SuggestedAction[] sortedSuggestedAction = country.getSuggestedActions();
for(Country.SuggestedAction suggestedAction : country.getSuggestedActions()) {
if (suggestedAction.section.equals("Legal Framework")) {
sortedSuggestedAction[0] = suggestedAction;
Expand All @@ -42,8 +43,8 @@ protected void onCreate(Bundle savedInstanceState) {
if (suggestedAction.section.equals("Social Programs")) {
sortedSuggestedAction[4] = suggestedAction;
}
}
for (Country.SuggestedAction suggestedAction : sortedSuggestedAction) {
}*/
for (Country.SuggestedAction suggestedAction : country.getSuggestedActions()) {
TextView header = (TextView) inflater.inflate(R.layout.suggested_actions_header, suggestedActionsLinearLayout, false);
header.setText(suggestedAction.section);
header.setContentDescription(suggestedAction.section + ", heading");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gov.dol.childlabor.activities;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -42,12 +42,28 @@ protected void onCreate(Bundle savedInstanceState) {
LinearLayout row = (LinearLayout) inflater.inflate(R.layout.project_row,suggestedActionsLinearLayout,false);
TextView title = row.findViewById(R.id.project_title);
TextView link = row.findViewById(R.id.project_link);


title.setText(projects.get(i).getTitle());
link.setText(projects.get(i).getLink());
link.setOnClickListener(view -> {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(((TextView)view).getText().toString()));
link.setContentDescription("i lab project link for "+ projects.get(i).getTitle());
/*link.setTag(projects.get(i).getLink());
SpannableString content = new SpannableString(projects.get(i).getTitle());
//content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
//content.setSpan(new URLSpan(projects.get(i).getLink()), 0, content.length(), 0);
Linkify.addLinks(content,Linkify.WEB_URLS);
link.setMovementMethod(LinkMovementMethod.getInstance());
link.setText(content);*/


String desc = "<font color=\"blue\"><a href='"+projects.get(i).getLink()+"'>"+projects.get(i).getTitle()+"</a></font>";
link.setText(Html.fromHtml(desc));
link.setMovementMethod(LinkMovementMethod.getInstance());

/*link.setOnClickListener(view -> {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(((TextView)view).getTag().toString()));
startActivity(intent);
});
});*/
suggestedActionsLinearLayout.addView(row);
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/project_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:paddingTop="10dp"
android:paddingRight="5dp"
android:paddingBottom="10dp"
android:visibility="gone"
android:text="Hello title"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
Expand All @@ -27,7 +28,6 @@
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:text="link"
android:clickable="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#0000EE" />

Expand Down

0 comments on commit 50c8a31

Please sign in to comment.