Skip to content

Commit

Permalink
Improved button bar
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciotogneri committed Feb 14, 2017
1 parent 685f477 commit b39d3ac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
Expand Down Expand Up @@ -143,6 +144,22 @@ public boolean onItemLongClick(AdapterView<?> parent, View view, int position, l
}
});

listView.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
if ((event.getAction() == MotionEvent.ACTION_DOWN) && listView.pointToPosition((int) (event.getX() * event.getXPrecision()), (int) (event.getY() * event.getYPrecision())) == -1)
{
onBackPressed();

return true;
}

return false;
}
});

refreshFolder();
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<style name="floatingButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_margin">10dp</item>
<item name="android:layout_marginRight">7dp</item>
<item name="android:layout_marginBottom">7dp</item>
<item name="android:clickable">true</item>
</style>

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<style name="floatingButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_margin">0dp</item>
<item name="android:layout_marginRight">-100dp</item>
<item name="android:layout_marginBottom">-100dp</item>
<item name="android:clickable">true</item>
</style>

Expand Down

0 comments on commit b39d3ac

Please sign in to comment.