コード例 #1
0
ファイル: StartActivity.java プロジェクト: Sajel/Ogolodali
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_start);

    search = Search.getInstance();

    status = (TextView) findViewById(R.id.statusTextView);
    progressBar = (ProgressBar) findViewById(R.id.connectingProgressBar);
    reconnectButton = (Button) findViewById(R.id.reconnectButton);
  }
コード例 #2
0
ファイル: StartActivity.java プロジェクト: Sajel/Ogolodali
 @Override
 protected Void doInBackground(Void... params) {
   SearchParser parser = null;
   try {
     Log.i("AsyncTask", "Task:" + this.hashCode() + ", Activity:" + activity.hashCode());
     try {
       parser = SearchParser.parse();
     } catch (IOException e) {
       e.printStackTrace();
     }
     search.setAllIngredients(parser.getIngredientsCategories());
     search.setAllTags(parser.getTagsCategories());
     Intent intent = new Intent(activity, MainActivity.class);
     activity.startActivity(intent);
   } catch (Exception e) {
     Log.e(activity.TAG, e.getStackTrace().toString());
     failed = true;
   }
   ;
   return null;
 }
コード例 #3
0
 @Override
 public View getChildView(
     int groupPosition,
     int childPosition,
     boolean isLastChild,
     View convertView,
     ViewGroup parent) {
   if (convertView == null) {
     convertView = layoutInflater.inflate(R.layout.item_expandble_list, parent, false);
   }
   TagsCategory category = (TagsCategory) getGroup(groupPosition);
   TextView tagName = (TextView) convertView.findViewById(R.id.elementsItemName);
   Tag tag = category.get(childPosition);
   tagName.setText(tag.getName());
   if (search.isChosen(tag)) {
     convertView.setBackgroundColor(Color.GRAY);
   } else {
     convertView.setBackgroundColor(Color.LTGRAY);
   }
   return convertView;
 }
コード例 #4
0
 public void changeData(Search search) {
   categories = search.getAllTags();
   this.search = search;
 }