1

Имеется большое изображение. Хотелось бы что это изображение было читабельным. Т.е. необходима возможность увеличивать его. Использовал Picaso. но что-то не так вот код активити.

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <ImageView
    android:scaleType="matrix"
    android:id="@+id/eur__e__s10__all_001"
    android:layout_marginEnd="16dp"
    android:layout_marginRight="16dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

      <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="@string/s10100BA270"
    android:id="@+id/textView2"
    android:layout_below="@+id/textView"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

     <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="@string/s10100BA260"
         android:layout_below="@+id/eur__e__s10__all_001"
    android:id="@+id/textView"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    />
</RelativeLayout>

Вот код java:

public class Eur_S10_ALL_E_001 extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_eur__s10__all__e_001);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);


    ImageView imageView = (ImageView) findViewById(R.id.eur__e__s10__all_001);
    Picasso.with(this)
            .load(R.drawable.s10_001_01)
            .resize(500,300)
            .into(imageView);





    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        }
    });
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
4
  • 1
    Попробуйте PhotoView из поста ru.stackoverflow.com/questions/525795/…
    – DimXenon
    24 мая 2016 в 9:54
  • 1
    "Что-то не так" - это вы имеете в виду, что слишком хорошее качество и его надо уменьшить?
    – ЮрийСПб
    24 мая 2016 в 9:54
  • @ЮрийСПб Ну в идеале, нужно чтобы можно было увеличить изображение без потери его качества.
    – Nexx
    24 мая 2016 в 9:55
  • 1
    @Nexx, вы слишком расплывчато сформулировали вопрос. Кроме первого коммента ничего сказать ибо непонятно что именно из означенных задач ваш код не сделал. "Что-то не так" - ничего не объясняет.
    – ЮрийСПб
    24 мая 2016 в 9:57

1 ответ 1

1

Я подключил вот эту библиотеку и меня это устраивает. Cпасибо @DimXenon

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.