/* Copyright 2012-2013 Andrey Zaytsev, Sergey Ivanov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package net.meiolania.apps.habrahabr.ui; import net.meiolania.apps.habrahabr.R; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.actionbarsherlock.view.ActionProvider; public class PageActionProvider extends ActionProvider { private Context context; private TextView pageView; private int page; public PageActionProvider(Context context) { super(context); this.context = context; } @Override public View onCreateActionView() { LayoutInflater layoutInflater = LayoutInflater.from(context); View view = layoutInflater.inflate(R.layout.page_action_provider, null); pageView = (TextView) view.findViewById(R.id.page); pageView.setText(String.valueOf(page)); return view; } public void setPage(int page) { this.page = page; } }