package com.lemenzo.gallery.smart;
import android.app.Fragment; import android.content.Intent; import android.os.Bundle; import android.view.*; import com.lemenzo.gallery.R; import com.lemenzo.gallery.search.SearchActivity;
public final class SmartFragment extends Fragment {
 @Override public View onCreateView(LayoutInflater i,ViewGroup c,Bundle s){View v=i.inflate(R.layout.fragment_smart,c,false);
  bind(v,R.id.smart_screenshots,"screenshots"); bind(v,R.id.smart_documents,"documents"); bind(v,R.id.smart_selfies,"selfies"); bind(v,R.id.smart_camera,"camera"); bind(v,R.id.smart_downloads,"downloads"); bind(v,R.id.smart_videos,"videos"); bind(v,R.id.smart_animated,"gif"); bind(v,R.id.smart_raw,"raw"); bind(v,R.id.smart_motion,"motion"); return v;}
 private void bind(View root,int id,String q){root.findViewById(id).setOnClickListener(v->{Intent x=new Intent(getActivity(),SearchActivity.class);x.putExtra(SearchActivity.EXTRA_INITIAL_QUERY,q);startActivity(x);});}
}
