Skip to content

Commit

Permalink
Fixed infinte scroling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikramjeet Singh authored and Vikramjeet Singh committed Feb 13, 2015
1 parent c51cd79 commit ff25922
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;

import com.etsy.android.grid.StaggeredGridView;
import com.example.vikramjeet.adapters.ImageAdapter;
Expand All @@ -37,7 +36,7 @@
public class ImageSearchActivity extends ActionBarActivity implements SettingsFilterDialog.SettingsFilterDialogListener {
private final int REQUEST_CODE = 200;
public static final String url = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q=";
private EditText etQuery;
// private EditText etQuery;
private StaggeredGridView gvResults;
private ArrayList<Image> images;
private ImageAdapter adapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public void onScroll(AbsListView view,int firstVisibleItem,int visibleItemCount,
if (totalItemCount < previousTotalItemCount) {
this.currentPage = this.startingPageIndex;
this.previousTotalItemCount = 0;
if (totalItemCount == 0) {
// if (totalItemCount == 8) {
this.loading = true;
}
// }
}
// If it’s still loading, we check to see if the dataset count has
// changed, if so we conclude it has finished loading and update the current page
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/res/menu/menu_image_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.vikramjeet.activities.ImageDetailActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />

<item android:id="@+id/miShare"
android:orderInCategory="1"
android:title="@string/action_share"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_share" />

</menu>
8 changes: 1 addition & 7 deletions app/src/main/res/menu/menu_image_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@
app:showAsAction="ifRoom|collapseActionView"
app:actionViewClass="android.support.v7.widget.SearchView" />

<item android:id="@+id/miShare"
android:orderInCategory="2"
android:title="@string/action_share"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_action_share" />

<item android:id="@+id/miFilters"
android:orderInCategory="3"
android:orderInCategory="2"
android:title="@string/action_settings"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_settings_filter" />
Expand Down

0 comments on commit ff25922

Please sign in to comment.