+/* AppSearchStuv.java
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package de.dhbwloe.campusapp.fragments;
-
-
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
+import android.widget.ProgressBar;
import java.util.ArrayList;
import java.util.List;
private AppSearchListAdapter appSearchAdapter;
private StuvSearchHelper seachHelper;
private ArrayList<AppSearchListItem> searchResultItems = new ArrayList<AppSearchListItem>();
+ private ProgressBar progressBar;
@Override
public void onCreate(Bundle savedInstanceState) {
if(bQueryExecuted && !reset)
return;
bQueryExecuted = true;
+ progressBar = (ProgressBar) oFragmentView.findViewById(R.id.searchProgress);
+ progressBar.setVisibility(View.VISIBLE);
searchResultItems.clear();
Log.i("SearchStuv", "Success: "+results.size());
for(AppSearchListItem result : results)
searchResultItems.add(result);
+ progressBar.setVisibility(View.GONE);
if(appSearchAdapter != null)
appSearchAdapter.notifyDataSetChanged();
}
@Override
public void onSearchFailed(String error) {
Log.i("SearchDhbw", "Failed: " + error);
+ progressBar.setVisibility(View.GONE);
}
});